kshipeng / SPUncaughtExceptionHandler

APP闪退时,由用户决定是否继续。宝宝再也不用担心APP闪退了
MIT License
70 stars 11 forks source link

请说明出现问题时,使用的Xcode、iOS系统的版本及测试使用的iPhone机型,以便复现您的问题。 #2

Open jj89757hhb opened 7 years ago

jj89757hhb commented 7 years ago

[_list addObject:nil] 数组添加nil 弹不出异常咋回事?

kshipeng commented 7 years ago

当向nil发送消息时,返回NO,不会有异常,程序将继续执行下去,而向NSNull的对象发送消息时会收到异常。 另外,如要确实需要存储一个表示“什么都没有”的值,可以使用NSNull类。 若还有问题,继续探讨😁

jj89757hhb commented 7 years ago

不会 崩溃 但是界面也异常的

kshipeng commented 7 years ago

我又重新查看了一下,在日志文件中是有记录崩溃信息的,但是Alert没有显示出来(将错误代码写在viewdidload中),通过查看视图层级发现,这种情况下只有window没有view。 但是,将错误代码写在按钮点击方法中,就会正常显示(其他地方应该也可以,但是未测试)。 我会继续寻找解决方法,如果您有好的方法,还请不吝赐教😁

yanyingxiang commented 6 years ago

Undefined symbols for architecture armv7: "ExceptionHandlerFinishNotify()", referenced from: ___57-[AppDelegate application:didFinishLaunchingWithOptions:]_block_invoke.24 in AppDelegate.o "InstallUncaughtExceptionHandler()", referenced from: -[AppDelegate application:didFinishLaunchingWithOptions:] in AppDelegate.o ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)

想问下楼主,文件导入项目,写在appdelegate.m didFinishLaunchingWithOptions方法里面,编译会报错,项目是支持armv7的

kshipeng commented 6 years ago

@yanyingxiang 我新建工程或者导入旧的工程中,并未出现你所描述的问题。建议你清理一下Xcode的缓存试试。