Inside Mac OS X 10.7 Lion: Crash or continue, push notifications

Posted:
in macOS edited January 2014
Developers have noted two interesting features in progress within the Mac OS X Lion release, one being the ability to continue an application poised to crash, and a second being the foundation of push notifications in Mac OS X.



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.







Push notifications



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)applicationNSApplication *)application didRegisterForRemoteNotificationsWithDeviceToken NSData *)deviceToken NS_AVAILABLE_MAC(10_7);

- (void)applicationNSApplication *)application didFailToRegisterForRemoteNotificationsWithError NSError *)error NS_AVAILABLE_MAC(10_7);

- (void)applicationNSApplication *)application didReceiveRemoteNotificationNSDictionary *)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.
«1

Comments

  • Reply 1 of 33
    I think the crash thing is for developers testing the beta. Popping up a window like that is unprofessional.
  • Reply 2 of 33
    Quote:
    Originally Posted by bdkennedy1 View Post


    I think the crash thing is for developers testing the beta. Popping up a window like that is unprofessional.



    Not really. We've been getting windows like this for years. App crashes, window pops up and conveys, "Your app crashed. Wanna report it? You can ignore the crash or reopen it and try again."



    What's the harm in taking it one step further? It's actually somewhat a step towards stability for the entire OS, if the user has slightly more control over when the app crashes. Like the article suggests at least just for saving current data, I think lots of people would be happy with that, myself included.



    It can also be good for developers in a lot of ways. One might be easier debugging, being able to continue the app running to gather information about the app's state and why it's crashing. I really hope they keep it.
  • Reply 3 of 33
    asciiascii Posts: 5,936member
    The continuation of a crashed app may be made practical by the new versioning file system. In the past it would be too risky to allow a user to continue, since it could save their document in an inconsistent state, destroying all their work. But now if that happens they can just roll back.



    Bringing PNS to the Mac is a great idea. If they use it for MobileMe new mail notifications, instead of IMAP IDLE, Mac could have the fastest new mail notifications of any computer.



    Is this article written by one of the new writers they were advertising for a few days ago? The little explanatory notes about Exceptions and Push Notifications are not something I've noticed before.



    Also, are those traffic lights smaller than Snow Leopard's?
  • Reply 4 of 33
    We used to (sort-of) have this back in the old days with Macsbug. On occasion I could hit the developer key when the system froze, get Macsbug to pop up and hit 'r' to resume. Didn't always work, but for early days it would sometimes let me save my work...
  • Reply 5 of 33
    Notice the window shows "hide details". In other words, the initial window that pops up contains minimal information (i.e. crash or continue) and thus would function like other windows of this type.



    Quote:
    Originally Posted by bdkennedy1 View Post


    I think the crash thing is for developers testing the beta. Popping up a window like that is unprofessional.



  • Reply 6 of 33
    Quote:
    Originally Posted by bdkennedy1 View Post


    I think the crash thing is for developers testing the beta. Popping up a window like that is unprofessional.



    I don't have a problem with it as long as the default is to save as. Otherwise you could be dealing with the possible corrupting of your data.
  • Reply 7 of 33
    Quote:
    Originally Posted by ascii View Post


    Also, are those traffic lights smaller than Snow Leopard's?



    Yes, the traffic lights are smaller in Lion.
  • Reply 8 of 33
    Wonder if the push notifications being baked into Lion will incorporate system or application level notifications as well (ie, Growl)?
  • Reply 9 of 33
    This doesn't seem necessary since Lion saves your documents automatically as you edit them. Although I'm not sure exactly go it works. If you just create an new untitled document, it might not save your work.
  • Reply 10 of 33
    Push already exists on Snow Leopard. They debuted in FaceTime. You don't need to leave FaceTime open in order to receive FaceTime calls, push notifications start it automatically.
  • Reply 11 of 33
    oomuoomu Posts: 130member
    Quote:
    Originally Posted by Mynameisjoe View Post


    This doesn't seem necessary since Lion saves your documents automatically as you edit them. Although I'm not sure exactly go it works. If you just create an new untitled document, it might not save your work.



    lion enabled applications of course save ALL THE TIME your documents, new or old, "saved" or not, named or not.



    if you just create a new untitled document, yup, it is saved.



    -

    "Save as" is no more in textedit. Now you have "save" who allow you to name the new document or create a new version immediately and "duplicate" to create a new document starting from an old.
  • Reply 12 of 33
    Should send a report whether one chooses to continue or allow to crash. None of us like to lose work/data but Apple and the Dev responsible need to know there is a problem. The file associated with the crash should be similarly marked with a prefix/suffix.
  • Reply 13 of 33
    Steaming military stripes? Flan?
  • Reply 14 of 33
    panupanu Posts: 135member
    Developers know what it means that "an uncaught exception was raised," but this is just gibberish to ordinary mortals. In fact, since it is in the passive voice, non-geeks might think they did something wrong. Apple's computers are for the rest of us, that is, for non-geeks. Apple should reword it to be something comprehensible, like "This application made a fatal error."



    I remember a computer operator at Merrill Lynch who remained at his seat for eight hours waiting for security to arrest him because the computer displayed "illegal operation performed." They forced the developer to rephrase the error message.



    The last sentence also needs rewriting. It should say, "If you choose Crash, you will lose any unsaved data."



    The passive voice is to be avoided. It obscures the subject, turning every sentence into a detective novel. I told someone once, "If you keep using the passive voice in every sentence, people will think you are lousy in bed." Guess who started writing in normal English!
  • Reply 15 of 33
    Quote:
    Originally Posted by jpellino View Post


    Steaming military stripes? Flan?



    I thought it was crème brûlée
  • Reply 16 of 33
    Quote:
    Originally Posted by Panu View Post


    Developers know what it means that "an uncaught exception was raised," but this is just gibberish to ordinary mortals. In fact, since it is in the passive voice, non-geeks might think they did something wrong. Apple's computers are for the rest of us, that is, for non-geeks. Apple should reword it to be something comprehensible, like "This application made a fatal error."



    At the very least it sounds existential; at worst, Windows-esque (an ethernet cable is unplugged).



    Reword it, yes, but "fatal error" is no better. A crash in which no one died isn't fatal... right?



    Quote:

    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),



    Perhaps it was written by an Aussie
  • Reply 17 of 33
    n42n42 Posts: 34member
    Quote:
    Originally Posted by jpellino View Post


    Steaming military stripes? Flan?



    http://www.plexapp.com/
  • Reply 18 of 33
    mstonemstone Posts: 11,510member
    Quote:
    Originally Posted by john galt View Post


    Perhaps it was written by an Aussie



    We're sorry but your application just chucked a wobbly.
  • Reply 19 of 33
    Windows 3.1 had something like this, but it was dropped in 95 in favour of the "Illegal Operation" compulsory shutdown (possibly because everyone would always try and continue in the inconsistent state and then complain when it broke ? I remember frantically clicking on Ignore every second or more desperately trying to prevent data loss). Maybe this version will be better-implemented.
  • Reply 20 of 33
    outsideroutsider Posts: 6,008member
    The makers of Growl can't be too happy.
Sign In or Register to comment.