0

我在我的应用程序中使用 Kal 日历。但是,当调用 Kal ViewWillAppear 时,我的应用程序崩溃了。这是我的代码。

-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    KalViewController *calendar = [[KalViewController alloc] init];
    [self.navigationController pushViewController:calendar animated:YES];
    calendar.dataSource = self;
    [calendar reloadData];
    self.tabBarController.delegate = self;
}

我使用了断点,我的应用程序在以下位置崩溃:

[calendar reloadData];

这是来自调试器的错误消息

* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[__NSArrayM insertObject:atIndex:]: object cannot be nil' * First throw call stack: (0x2088012 0x156ae7e 0x203bb6a 0x203ba20 0x10c1b 0x1ca08 0x11088 0x282103 0x28242b 0x297fad 0x29889b 0x2989b9 0x298a45 0x39e20b 0x1ef2dd 0x157e6b0 0x72d4fc0 0x72c933c 0x72d4eaf 0x28e2bd 0x1d6b56 0x1d566f 0x1d5589 0x1d47e4 0x1d461e 0x1d53d9 0x1d82d2 0x28299c 0x1cf574 0x1cf76f 0x1cf905 0x1d8917 0x2580 0x19c157 0x19c747 0x19d94b 0x1aecb5 0x1afbeb 0x1a1698 0x22c1df9 0x22c1ad0 0x1ffdbf5 0x1ffd962 0x202ebb6 0x202df44 0x202de1b 0x19d17a 0x19effc 0x227d 0x21a5) libc++abi.dylib: terminate called throwing an exception ( lldb)

顺便说一句,我的应用程序只有在我有一些数据要插入日历时才会崩溃。

4

1 回答 1

0

我找到了答案!我从 Core Data 获得了一个日期,但格式化程序错误,日期显示为零。

于 2013-07-27T15:13:39.447 回答