【代码笔记】iOS-用户发布后能保存崩溃

一,工程图。

二,代码。

AppDelegate.m

复制代码
#import "AppDelegate.h"
#import "RootViewController.h"
#import "NdUncaughtExceptionHandler.h"

@implementation AppDelegate



- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    
    
    RootViewController *rootVC=[[RootViewController alloc]init];
    UINavigationController *nav=[[UINavigationController alloc]initWithRootViewController:rootVC];
    self.window.rootViewController=nav;
    
    
    //使用方法
   [NdUncaughtExceptionHandler setDefaultHandler];
   
    
    
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
    return YES;
}
复制代码

 

原文地址:https://www.cnblogs.com/yang-guang-girl/p/5680242.html