2014-07-23 26 views
0

我的项目是崩溃找出错误,并指出以下行main.m文件如何从日志

return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 

,并显示如下,而且再也找不到文件或行号修复登录控制台错误。

2014-07-23 13:24:08.564 Test Project[11312:707] Starting app 
2014-07-23 13:24:08.577 Test Project[11312:707] Application windows are expected to have a root view controller at the end of application launch 
2014-07-23 13:24:08.969 Test Project[11312:707] get pin pass 
2014-07-23 13:24:08.973 Test Project[11312:707] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayI objectAtIndex:]: index 0 beyond bounds for empty array' 
*** First throw call stack: 
(0x36c5f88f 0x33076259 0x36bb723d 0x987e7 0x32892933 0x36c33a33 0x36c33699 0x36c3226f 0x36bb54a5 0x36bb536d 0x34d7c439 0x34e5ecd5 0x93679 0x935c8) 
terminate called throwing an exception(lldb) 

有一点*** -[__NSArrayI objectAtIndex:]:但它在所有文件中使用越来越多。

如何解决这个错误。

+0

运行的Xcode工具简介僵尸。 –

+2

您是否添加了异常断点? – trojanfoe

回答

0

你的日志输出“get pin pass”,所以在你的项目中找到这个文本,看看你在哪个空的数组上调用[NSArray objectAtIndex:]。该数组中没有任何对象。这样做是为了避免碰撞

if(array.count > index){ 
    [NSArray objectAtIndex:index]; 
} 

希望这有助于

+0

我明白这一点,但很多次使用阵列。它是哪个阵列。如何找到。 – Salim