> The latter is just a notification that the application created internally, > and as a convenience passed to its delegate before or after broadcasting it > using NSNotificationCenter.
Actually the delegate gets automatically registered as an observer of that notification, which makes sense - it's more efficient than doing the whole "respondsToSelector" thing. Found that out after an inadvertent call to the simple removeObserver: killed off the delegate method calls too. ________________________________________ From: [email protected] [[email protected]] on behalf of Graham Cox [[email protected]] Sent: Thursday, February 26, 2015 8:12 PM To: Alex Kac Cc: Cocoa-Dev Cocoa-Dev Mail Subject: Re: Exception on launch when clicking on an NSUserNotification OK, I may be having a massive misunderstanding about how iOS works (as compared with Mac OS), but the NSUserNotification you post is, as far as I'm aware, completely unrelated to the NSNotification that is passed to -applicationWill/DidFinishLaunching. The latter is just a notification that the application created internally, and as a convenience passed to its delegate before or after broadcasting it using NSNotificationCenter. The user notification you post just triggers the notification system. I realise it's pretty confusing with everything being called more or less the same thing, but they are totally different. The userInfo you pass in your user notificaiton will not turn up in the app delegate's did launch notification. (Unless, that is, iOS is documented to do that. Mac OS definitely doesn't). --Graham > On 27 Feb 2015, at 1:17 pm, Alex Kac <[email protected]> wrote: > > However I'm having a problem on launching the app by tapping on the > notification. My app gets an applicationWillFinishLaunching, and then gets an > exception before it hits applicationDidFinishLaunching. > > https://urldefense.proofpoint.com/v2/url?u=https-3A__www.dropbox.com_s_nmf6qr97su43plh_Screenshot-25202015-2D02-2D25-252021.38.37.png-3Fdl-3D0&d=AwIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=ie7S-J__EKnfyVOBV7-jV2rZ--p47O6vkyTklpDM3h4&m=59sIEZjKOL349HNehyxjpwItIsYCQisDuEhDJ4dKKQo&s=8Rrc63Ub-OjEXEUUgXmMSj0Ic6BYZC7HdeUG8VmQgAo&e= > > I can continue, and the app then runs…but no > NSApplicationLaunchUserNotificationKey in the notification. > NSConcreteNotification 0x6100002555d0 {name = > NSApplicationDidFinishLaunchingNotification; object = <PIApplication: > 0x618000115570>; userInfo = { > NSApplicationLaunchIsDefaultLaunchKey = 0; > }} > > I am debugging the launch by using XCode's "Wait for executable to be > launched" option in the scheme, then tapping on my notification to launch the > app. > > There is no info in the console. > > The notification being scheduled is: > <NSUserNotification:0x10149d2c0> { title: "Test" informativeText: "9:55 PM" > actionButtonTitle: "Snooze" next delivery date: 2015-02-26 04:54:47 +0000 } > > I am using 10.10 action item (snooze options). I’ve Googled this with no > luck. My only guess was that there was something in the notification that > wasn’t decodeable…but I’ve checked every property of the notification just to > be sure I didn’t do something stupid and its all good. > _______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/lrucker%40vmware.com This email sent to [email protected] _______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
