Inside Mac OS X 10.7 Lion: Crash or continue, push notifications
AppleInsider may earn an affiliate commission on purchases made through links on our site.
Crash or continue
When Lion encounters an app that raises an exception and fails to properly handle it (essentially throwing an object in the air and filing to catch it), it now offers the user the choice of either allowing the app to crash or a new option of continuing to allow the app to run.
While this results in the app running in an inconsistent state, it does allow the user at least an attempt at saving data in any open files before quitting the app are restarting it fresh.
The error dialog below indicates how an app that suffers a internal error presents the option to the user, providing a look at what caused the problem.
Another feature discovered in the bowels of Lion is the foundation of push notifications, something Apple originally created for iOS. While apparently not yet fully functional, a developer reports that "the whole range of callbacks for iOS push notifications have been added to NSApplicationDelegate."
- (void)application:(NSApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken NS_AVAILABLE_MAC(10_7);
- (void)application:(NSApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error NS_AVAILABLE_MAC(10_7);
- (void)application:(NSApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo NS_AVAILABLE_MAC(10_7);
Apple's push notification system allows developers to create services that update the user with notices of new information. The feature is most useful in mobile devices, where constantly polling the network for new emails, news, or other content is a waste of battery life. However, it appears that a consistent push notifications mechanism across both Mac OS X and iOS could be useful in delivering software that works the same on both systems.
Push notifications work by holding an IP connection open, waiting for a message. Essentially, it's like waiting for the phone to ring rather than running to the mailbox every few minutes to see if you've received a reply. Apple's Push Notification Server currently relays messages to iOS users, which can be badge number increments, short messages, or sounds.
Apple has shared a great deal of technology between iOS and Mac OS X, and continues to do so everywhere it makes sense. The result has been not only shared effort on Apple's side, but also a familiar and usually consistent environment for developers who want to target both.