Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

binjaja

macrumors newbie
Original poster
Nov 13, 2008
10
0
How do you alert the user that you are about to exit the app? I've been struggling with this for some time... When I am many levels deep in the code and get an unrecoverable error, (file system problem, database problem) I want to alert the user using UIAlert , then exit. The problem is that UIAlert only displays at the beginning of the next run cycle, so in order to get there , I need to cleanly return from many levels deep in the code. I don't want to do that...

I tried using [self.view presentError], which will go up the chain to the top of the app , then show an alert, however I don't think its supported on the iPhone because I couldn't get it compiled.

Any suggestions? Is there something like CFRunLoopStop that won't STOP the run loop, it will just go to the top of it? Is there something that will return,return,return,return up through my methods till I get to the top of the run loop so the alert will show? Or do I have to return all the way up the chain when I find an error?

Thanks!
 

gold248

macrumors newbie
Apr 22, 2010
1
0
So, basically, you're wanting to notify the user before your app crashes?

Is there a better way to debug applications? I'm working on a port of an application from another platform to the iPhone. It consists of over 450 files and 5MB of code. When this app asserts, I'd like to be able to give our QA Department useful information about where exactly in the code the assertion failed.

I'm totally new to mac programming. If you have any suggestions on how to do what the original poster was asking, please speak up.
 

fishkorp

macrumors 68030
Apr 10, 2006
2,536
650
Ellicott City, MD
Wirelessly posted (Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_1_2 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.4 Mobile/7D11 Safari/531.21.10)

You can pull the crash logs off the phone.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.