1、[NSPlaceholderString initWithString:]: nil argument- 是參數為空導致!
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSPlaceholderString initWithString:]: nil argument'
*** First throw call stack:
(0x35a5788f 0x37dfe259 0x35a57789 0x35a577ab 0x354ff4c9 0x39756f 0x398137 0x39b5a3 0x354e6a81 0x3557a591 0x32e1a735 0x32e1a5f0)
terminate called throwing an exceptionterminate called throwing an exception(lldb)
一個大坑找了好久,原來是傳參數A,A參數為空!!
2、libc++abi.dylib: terminate_handler unexpectedly threw an exception
我們在運行xcode工程時,有時候會遇到”libc++abi.dylib: terminate_handler unexpectedly threw an exception”錯誤,app莫名其妙就crash掉了,在控制臺輸入bt命令,查看調用堆棧,結果也是一頭霧水:
基于以上分析,我們可以跟蹤斷點,會發現程序在對mutable對象進行add、set等操作時掛掉,而這個對象實際上賦值的是一個不可變對象。常見的情況是把一個NSArray對象賦值給一個NSMutableArray對象,然后進行了delete、add等修改操作,或者把一個NSDictionary對象賦值給一個NSMutableDictionary對象,然后進行了set等操作。