views:

51

answers:

2

I have a Cocoa application which works fine except it will not invoke applicationDidFinishLauching on my app delegate. applicationWillFinishLauching does work though.

In IB I have set the delegate from "Application" (and also File's owner) to my "XXX App Delegate" object. All other application specific methods are called correctly weirdly enough.

What could I be doing wrong; I have no idea where to search anymore

My code:

@interface NZBVortexAppDelegate : NSObject
{
    NSWindow *window;
    NZBqueue *connectionPool;
    MainWindowViewController *mainWindowViewController;
}

@property (assign) IBOutlet NSWindow *window;
@end

.m file

@implementation NZBVortexAppDelegate

@synthesize window;

-(void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    NSLog(@"Not invoked");
}

- (void)applicationWillFinishLaunching:(NSNotification *)aNotification {
        NSLog(@"Invoked");
}

@end

Can you give me some pointers? I even stepped from WillFinishLauching (step in and over) but do not seem to hit any of my code anymore, can't debug more from within the frameworks.

+2  A: 

If you are building a Mac OS X application then this is indeed strange. If, on the other hand you are working on an iOS app then this is expected as for some unknown reason Apple changed the method every so slightly. In OS X your method above is exactly correct for iOS where you have NSNotification * in applicationDidFinishLaunching: it should be UIApplication *. I have no idea why they did this as applicationWillFinishLaunching: is still an NSNotification.

theMikeSwan
Even in that Cocoa Touch case, though, the message would still go through, since the selector is the same; he just wouldn't have the kind of object he's expecting in that variable.
Peter Hosey
A: 

I got the answer, it seems my preferences plist was a bit corrupt causing Sparkle SUUpdater object never to finish checking a update during startup and in turn blocking the event being called. Took me a few hours to figure out because sparkle doesn't log this issue at least.

I've contacted the Sparkle developer to add a little more sanity checking. Thanks guys!

Ger Teunis