如何高效的调试 IOS bug
我是一名正在自学IOS的码农,以前是做PHP的,对IOS崩溃不太会调试代码,所以程序一崩溃就懵了,今天写了个自动切换主题的类,一调用这个类在UIBarButtonItem 返回的时候调用 [self.navigationController popViewControllerAnimated:YES]; 就崩溃了,断点打在这个位置发现执行不下去,很奇怪,崩溃信息如下,
2013-08-20 21:42:40.586 Weibo[1247:907] -[__NSCFArray _isAncestorOfFirstResponder]: unrecognized selector sent to instance 0x74aa6d0
2013-08-20 21:42:40.689 Weibo[1247:907] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFArray _isAncestorOfFirstResponder]: unrecognized selector sent to instance 0x74aa6d0'
*** First throw call stack:
(0x15e1012 0x1406e7e 0x166c4bd 0x15d0bbc 0x15d094e 0x42cc33 0x441d82 0x5c8961 0x5c8658 0x444651 0x44489b 0x445dc6 0x446065 0x445015 0x168f6 0x141a705 0x34e2c0 0x34e258 0x40f021 0x40f57f 0x40e6e8 0x37dcef 0x37df02 0x35bd4a 0x34d698 0x1a5edf9 0x1a5ead0 0x1556bf5 0x1556962 0x1587bb6 0x1586f44 0x1586e1b 0x1a5d7e3 0x1a5d668 0x34affc 0x2b12 0x2a45)
libc++abi.dylib: terminate called throwing an exception
Printing description of argv:
(char **) argv = 0xbffff40c
另外如何高效的调试代码?