因此,我尝试使用 NSMutableArray 加载图像,但在尝试运行时不断出现错误。没有一个值是零,所以我不知道为什么!这是发生崩溃的代码:
imagesQueue = [[NSMutableArray alloc] init];
[imagesQueue addObject:[UIImage imageNamed:@"slideshow_1.jpg"]];
[imagesQueue addObject:[UIImage imageNamed:@"slideshow_2.jpg"]];
[imagesQueue addObject:[UIImage imageNamed:@"slideshow_3.jpg"]];
[imagesQueue addObject:[UIImage imageNamed:@"slideshow_4.jpg"]];
[imagesQueue addObject:[UIImage imageNamed:@"slideshow_5.jpg"]];
[imagesQueue addObject:[UIImage imageNamed:@"slideshow_6.jpg"]];
我在调试中收到的错误是:
2013-07-26 20:25:56.846 Level 27[44156:a0b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
*** First throw call stack:
(0x16c59b8 0x14468b6 0x167803c 0x1677ce0 0x8c18 0x34b9fc 0x34bc98 0xa533 0xa024 0x34b9fc 0x34bc98 0x28abba 0x28c593 0x28c47b 0x25188c 0x66d9df 0x66d7a0 0x66d537 0x66cf76 0x67106b 0x66fe11 0x24905e 0x248b32 0x25c615 0x240e60 0x2416e9 0x242b5e 0x258a6c 0x258fd9 0x2447d5 0x35bc906 0x35bc411 0x16413e5 0x164111b 0x166bb30 0x166b10d 0x166af3b 0x2422b1 0x2444eb 0x960d 0x1d25725)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
请帮忙,我试过了,试过了!谢谢!