我在我的應用程序中使用Kal日曆。然而,當Kal ViewWillAppear被調用時,我的應用程序崩潰。這是我的代碼。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];
下面是調試
*終止應用程序錯誤消息由於未捕獲的異常「NSInvalidArgumentException」,究其原因: '* - [__ NSArrayM insertObject:atIndex:]:object can not be nil' *第一次調用堆棧: (0x2088 012 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:終止調用拋出異常 (lldb)
順便說一句,我的應用程序只有當我有一些數據插入日曆時崩潰。