IOS app: is there life after a crash and completion?

I am trying to create an iOS crash reporter tool. I wonder if the application can send information about the accident after its completion.

So my questions are: - What is the life cycle of an iOS application after completion? - Where can I find out more about what iOS does for the application upon completion?

+4
source share
4 answers

Performing any non-asynchronous task when the application crashes is strongly NOT -recommendable!

  • You are not allowed to allocate any new memory at this time.
  • ( Objective-C )
  • , .
  • .

, PLCrashReporter:

, . .

+7

, ... , iOS , - async (, , iOS7 NSURLSession), , , .
-applicationDidFinishLaunching :

-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        NSSetUncaughtExceptionHandler(&myExcHandler);
        /* your code*/
    }

myExcHandler - C, NSException , .

void myExcHandler(NSException *exception)
{
  //set something on NSUserDefault to check at next start
}

, lib. , -)

+3

Apple docs

( ) , applicationWillTerminate: , . , , . 5 . , .

"App Termination", .

, .

0

The last event you received to complete the application is in the method applicationWillTerminate. This method will not be called if the application is paused. You can track the crash log on your computer application if your application crashes after completion here:

~/Library/Logs/CrashReporter/MobileDevice/<your iPhone’s name>/

0
source

All Articles