Hi folks,
I am trying to change a static method to an instance method, ListenOnOpenURL, to be the method which is invoked by the delegate, so that I can invoke the method Foo below. I have been able to use FIOSCoreDelegates::OnOpenURL with a static method fine, but I just can’t seem to put the pieces together from the docs to bind this delegate to the instance method of this class. Any idea how to get this to work?
Here’s what I have:
static void ListenOnOpenURL(UIApplication* application, NSURL* url, NSString* sourceApplication, id annotation) {
NSLog(@"ListenOnOpenURL");
//Foo(); doesn't work because static method
}
void UMyClass::Init() {
FIOSCoreDelegates::OnOpenURL.AddStatic(&ListenOnOpenURL);
}
void UMyClass::Foo() {}
Here’s what I’d like to do:
void UMyClass::ListenOnOpenURL(UIApplication* application, NSURL* url, NSString* sourceApplication, id annotation) {
NSLog(@"ListenOnOpenURL");
Foo();
}
void UMyClass::Init() {
FIOSCoreDelegates::OnOpenURL.BindSomehow(self, &ListenOnOpenURL);
}
void UMyClass::Foo() {}