【问题标题】:application received SIGABRT and died in ipad but same things runs on simulator fine应用程序收到 SIGABRT 并在 ipad 中死亡,但同样的东西在模拟器上运行良好
【发布时间】:2011-07-05 11:08:25
【问题描述】:

我的应用程序在我的模拟器中运行良好,但每当我将它安装在 ipad 中时 它收到 SIGABRT 并死亡

2011-07-05 16:23:59.575 slots2[11008:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSMutableArray insertObject:atIndex:]: attempt to insert nil object at 0'
*** Call stack at first throw:
(
0   CoreFoundation                      0x3398964f __exceptionPreprocess + 114
1   libobjc.A.dylib                     0x321d5c5d objc_exception_throw + 24
2   CoreFoundation                      0x338f1efd -[__NSArrayM insertObject:atIndex:] + 472
3   CoreFoundation                      0x338f1d1b -[__NSArrayM addObject:] + 34
4   slots2                              0x00005215 -[slots2ViewController viewDidLoad] + 420
5   UIKit                               0x3485ef0f -[UIViewController view] + 110
6   slots2                              0x00002d31 -[slots2AppDelegate application:didFinishLaunchingWithOptions:] + 92
7   UIKit                               0x3485d821 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 772
8   UIKit                               0x34857b65 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 272
9   UIKit                               0x3482c7d7 -[UIApplication handleEvent:withNewEvent:] + 1114
10  UIKit                               0x3482c215 -[UIApplication sendEvent:] + 44
11  UIKit                               0x3482bc53 _UIApplicationHandleEvent + 5090
12  GraphicsServices                    0x33bcde77 PurpleEventCallback + 666
13  CoreFoundation                      0x33960a97 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 26
14  CoreFoundation                      0x3396283f __CFRunLoopDoSource1 + 166
15  CoreFoundation                      0x3396360d __CFRunLoopRun + 520
16  CoreFoundation                      0x338f3ec3 CFRunLoopRunSpecific + 230
17  CoreFoundation                      0x338f3dcb CFRunLoopRunInMode + 58
18  UIKit                               0x34856d49 -[UIApplication _run] + 372
19  UIKit                               0x34854807 UIApplicationMain + 670
20  slots2                              0x00002c91 main + 88
21  slots2                              0x00002c34 start + 40
)

terminate called after throwing an instance of 'NSException'
Program received signal:  “SIGABRT”.
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3.1 (8G4)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib (file not found).
(gdb) 

但我确定所有文件都在那里,因为在模拟器中运行相同的东西

下面的数组是可能有问题的数组

  NSString *SubDir = [NSString stringWithFormat:@"/R/%d",Theme];
for(int i = 0;i<11;i++)
 [SpinAnimationArray addObject:[UIImage  imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"blur%d",i] ofType:@"png" inDirectory:SubDir]]];

【问题讨论】:

  • 没有代码,很难确定,但您似乎将nil 对象添加到可变数组中。你能在你正在做的地方添加代码吗?
  • 我已将其添加到主要问题中

标签: ipad crash


【解决方案1】:

在 slot2ViewController viewDidLoad 中

你有一个数组,你试图添加索引错误的对象。

结帐

blur0 - blur10 png 被复制并存在于你的目标中

【讨论】:

  • blur0 - blur10 png 被复制并存在于您的目标中
  • 现在我明白了为什么它不能在模拟器上运行只是运行旧副本但在我的项目中我在移动时不小心删除了它们
  • 所以将它们全部复制到你的项目中
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-04-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-09-24
相关资源
最近更新 更多