@try - catch block in Objective-C

后端 未结 3 710
旧时难觅i
旧时难觅i 2020-12-07 11:44

Why doesn\'t @try block work? It crashed the app, but it was supposed to be caught by the @try block.

 NSString* test = [NSString stringWithString:@\"ss\"];
         


        
3条回答
  •  再見小時候
    2020-12-07 12:13

    Now I've found the problem.

    Removing the obj_exception_throw from my breakpoints solved this. Now it's caught by the @try block and also, NSSetUncaughtExceptionHandler will handle this if a @try block is missing.

提交回复
热议问题