ios - NSNotificationCenter callback while app in background -
one question , 1 issue: have next code:
- (void) registerforlocalcalendarchanges { [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(localcalendarstorechanged) name:ekeventstorechangednotification object:store ]; } - (void) localcalendarstorechanged { // gets phone call when event in store changes // have go through calendar changes [self getcalendarevents]; }
these methods in class/object called calendareventreporter contains method getcalendarevents (in callback).
two things: 1) if app in background callback not run. there way create that? 2) when bring app foreground (after having changed calendar on device) app crashes without error message in debug window or on device. guess calendareventreporter object contains callback beingness garbage-collected. possible? other thoughts on might causing crash? or how see error messages?
1) in order app run in background should using 1 of modes mentioned in "background execution , multitasking section here:
uses location services records or plays audio provides voip services background refresh connection external devices through bleif not using of above, not possible asynchronous events in background.
2) in order see crash logs/call stack place exception breakpoint or "device logs" section here: window->organizer->devices->"device name" on left->device logs on xcode.
ios objective-c nsnotificationcenter ekeventkit
No comments:
Post a Comment