xcode - 加载 View 时没有模拟器时iPad崩溃

标签 xcode ipad crash nsarray ios-simulator

当我在模拟器中打开新 View 时,我的应用程序在iPad上崩溃,即使在模拟器中它的运行方式也一样。

任何帮助深表感谢!

提前致谢

控制台输出:

2012-07-18 10:32:19.783 Coverdale[3484:707] *** Terminating app due to uncaught exception  'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 4 beyond bounds [0 .. 3]'
First throw call stack:
(0x3757688f 0x315eb259 0x374bf9db 0x37745 0x35c3f 0x306e3c8b 0x30708481 0x306ccbd5 0x3078f359 0x306d53b5 0x306d53d1 0x306d5263 0x3078f31f 0x307446cb 0x3074400f 0x3078dc05 0x3078c367 0x307e76a7 0x2c4fb 0x3075c93d 0x307d6627 0x33093933 0x3754aa33 0x3754a699 0x3754926f 0x374cc4a5 0x374cc36d 0x376c5439 0x306d8cd5 0x22103 0x220a8)
terminate called throwing an exception(lldb) 

崩溃报告
Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread:  0

Last Exception Backtrace:
0   CoreFoundation                  0x3757688f __exceptionPreprocess + 163
1   libobjc.A.dylib                 0x315eb259 objc_exception_throw + 33
2   CoreFoundation                  0x374bf9db -[__NSArrayM objectAtIndex:] + 271
3   Coverdale                       0x00092745 -[PreparationViewController setDetails:newFile:] (PreparationViewController.m:376)
4   Coverdale                       0x00090c3f -[PreparationViewController viewDidLoad] (PreparationViewController.m:70)
5   UIKit                           0x306e3c8b -[UIViewController view] + 167
6   UIKit                           0x30708481 -[UIViewController nextResponder] + 21
7   UIKit                           0x306ccbd5 -[UIResponder _containsResponder:] + 37
8   UIKit                           0x3078f359 -[UINavigationController defaultFirstResponder] + 57
9   UIKit                           0x306d53b5 -[UIResponder(Internal) _deepestDefaultFirstResponder] + 25
10  UIKit                           0x306d53d1 -[UIResponder(Internal) _deepestDefaultFirstResponder] + 53
11  UIKit                           0x306d5263 -[UIResponder(Internal) _promoteDeepestDefaultFirstResponder] + 31
12  UIKit                           0x3078f31f -[UIWindowController transitionViewDidStart:] + 83
13  UIKit                           0x307446cb -[UITransitionView _didStartTransition] + 71
14  UIKit                           0x3074400f -[UITransitionView transition:fromView:toView:] + 999
15  UIKit                           0x3078dc05 -[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:] + 4937
16  UIKit                           0x3078c367 -[UIViewController presentViewController:withTransition:completion:] + 3123
17  UIKit                           0x307e76a7 -[UIViewController presentModalViewController:animated:] + 31
18  Coverdale                       0x000874fb -[IntroTableViewController tableView:didSelectRowAtIndexPath:] (IntroTableViewController.m:498)
19  UIKit                           0x3075c93d -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 945
20  UIKit                           0x307d6627 -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 159
21  Foundation                      0x33093933 __NSFireDelayedPerform + 415
22  CoreFoundation                  0x3754aa33 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 15
23  CoreFoundation                  0x3754a699 __CFRunLoopDoTimer + 365
24  CoreFoundation                  0x3754926f __CFRunLoopRun + 1207
25  CoreFoundation                  0x374cc4a5 CFRunLoopRunSpecific + 301
26  CoreFoundation                  0x374cc36d CFRunLoopRunInMode + 105
27  GraphicsServices                0x376c5439 GSEventRunModal + 137
28  UIKit                           0x306d8cd5 UIApplicationMain + 1081
29  Coverdale                       0x0007d103 main (main.m:17)
30  Coverdale                       0x0007d0a8 start + 40


Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib          0x3291b32c __pthread_kill + 8
1   libsystem_c.dylib               0x34c90208 pthread_kill + 48
2   libsystem_c.dylib               0x34c89298 abort + 88
3   libc++abi.dylib                 0x3229ef64 abort_message + 40
4   libc++abi.dylib                 0x3229c346 _ZL17default_terminatev + 18
5   libobjc.A.dylib                 0x315eb350 _objc_terminate + 140
6   libc++abi.dylib                 0x3229c3be _ZL19safe_handler_callerPFvvE + 70
7   libc++abi.dylib                 0x3229c44a std::terminate() + 14
8   libc++abi.dylib                 0x3229d81e __cxa_rethrow + 82
9   libobjc.A.dylib                 0x315eb2a2 objc_exception_rethrow + 6
10  CoreFoundation                  0x374cc506 CFRunLoopRunSpecific + 398
11  CoreFoundation                  0x374cc366 CFRunLoopRunInMode + 98
12  GraphicsServices                0x376c5432 GSEventRunModal + 130
13  UIKit                           0x306d8cce UIApplicationMain + 1074
14  Coverdale                       0x0007d0fc main (main.m:17)
15  Coverdale                       0x0007d0a0 start + 32

最佳答案

我在iPad上删除了该应用程序,然后再次运行。

看来从我用componentsSeparatedByString:读取的文本文件生成的数组的条目少于我正在访问的条目。

关于xcode - 加载 View 时没有模拟器时iPad崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11537412/

相关文章:

ios - ScrollView 设计可行性 - iOS

cocoa - 如何避免XCode框架弱链接问题?

iphone - 在 iPad 上横向启动应用程序

ios - PresentViewController 在 iOS 4.3 上崩溃但在 iOS 5 上没有

ios - 将用于 Objective-C 的 Google API 客户端库添加到 Xcode 项目

ios - "Signing identity"和 "certificate"之间的区别?

jquery - 使用 ipad 而不是 web 查看网站时视频大小调整

objective-c - 为什么 SLComposeViewController 不在 Ipad 中共享文本和链接?

linux - 使用 boost 和 C++11 构建进程崩溃

ios - 应用仅在 Release模式下崩溃