我想创建一个tableview跟着一个例子代码放在一本书上,但它总是崩溃。 调试器给我看信息:如何修复由于未捕获的异常'NSRangeException'导致tableview崩溃,原因:'*** - [__ NSArrayM objectAtIndex:]:索引1超越界限[0 .. 0]'
2012-08-03 02:51:09.854 TableView[652:c07] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 1 beyond bounds [0 .. 0]'
*** First throw call stack:
(0x1794022 0x1194cd6 0x1780d88 0xfdd1b7 0x3b24 0x2e62 0xb2c54 0xb33ce 0x9ecbd 0xad6f1 0x56d21 0x1795e42 0x2065679 0x206f579 0x1ff44f7 0x1ff63f6 0x2083160 0x16e84 0x17767 0x26183 0x26c38 0x1a634 0x167eef5 0x1768195 0x16ccff2 0x16cb8da 0x16cad84 0x16cac9b 0x16c65 0x18626 0x1eb2 0x1e25)
terminate called throwing an exception(lldb)
我不知道这是什么意思。对不起,长码再次.... 如有必要,我可以发送整个代码。
有人在网上说问题发生是由于plist,http://p2p.wrox.com/271591-post2.html ,但我不能修改Xcode 4中的plist。4.Xcode显示绿色指针此代码
- (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath
{
NSManagedObject *object = [self.fetchedResultsController objectAtIndexPath:indexPath];
cell.textLabel.text = [[object valueForKey:@"timeStamp"] description];
}
你能减少你发布的代码量吗?尝试只发布相关的代码崩溃发生在 – 2012-08-02 19:37:40
@DanF对不起,我是新的objective-c.Maybe这就是你想要的。 – kururu623 2012-08-02 20:08:13