[Interest] QIOSApplicationDelegate and Categories
nunosantos at imaginando.pt
Wed May 10 12:20:33 CEST 2017
On my iOS apps I’m using categories to be to catch the didFinishLaunchingWithOptions method:
//! Add a category to QIOSApplicationDelegate
@interface QIOSApplicationDelegate (MyApplicationDelegate)
@implementation QIOSApplicationDelegate (MyApplicationDelegate)
I was also calling a method from C++ in order to initialise a second app delegate.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
static dispatch_once_t pred;
static MyAppDelegate *shared = nil;
shared = [[super alloc] init];
This was interfering with a lib I wanted to use, rendering it unusable. My option was to get ride of the secondary app delegate and use categories only.
The problem is that now, I don’t know how to call the AppDelegate from the C++ methods in the Cocoa side. I used to do something like this:
MyAppDelegate *app = [MyAppDelegate sharedMyAppDelegate];
Question: how can I refer from C++ on the Cocoa side to the AppDelegate associated with the category MyApplicationDelegate so that I can call myNewMethodDeclaredOnMyApplicationDelegate?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Interest