Making failed NSAsserts crash an app
Making failed NSAsserts crash an app
- Subject: Making failed NSAsserts crash an app
- From: Squ Aire <email@hidden>
- Date: Wed, 26 Aug 2009 21:49:53 +0000
- Importance: Normal
I am planning on using one of the nice crash reporter code/frameworks that are available on the internet that allow me to do stuff that I have seen in many Mac apps. Namely, to allow the user to more easily send me a crash log (plus some user comments on what the user was doing when the app crashed) the next time he launched an app after the crash.
Since I absolutely want some information on whenever my NSAsserts fail (because they should NEVER fail and I want to know about it if they do! (at least during beta testing!)), my question is: How can I guarantee that a failed NSAssert will crash my application? I want it to happen in such a way that the next time the user loads the app, the info about the failed NSAssert (perhaps the 2nd description string argument I supply to it, or even the line of code and code file) will go along with the crash reports.
How can can I accomplish this? Actually, since I have never worried about this crash log stuff until now, and I'm getting a bit nervous about implementing this correctly for production, I'd just like to ask, is there anything I need to configure for this to work? Do the Cocoa frameworks or Mac OS X itself automatically take care of producing those crash logs and putting them into the ~/Library/Logs folder (that the crash reporter framework can then go ahead and put into the UI)? Or is there anything I have to do myself to make the mechanism work?
A final, not 100% related but still related question: Will doing a simple NSLog show up in the crash log in that ~/Library/Logs folder? Or is it only shown in the Console utility? Just to avoid confusion, regard this as an unrelated question not connected to what I've written above.
_________________________________________________________________
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.
http://www.microsoft.com/windows/windowslive/products/photos.aspx_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden