在应用程序启动过程中,我显示一个表视图。每行以某种形式显示一个托管对象的数据。一位客户报告应用程序启动时发生崩溃。我看着他的崩溃日志,并可以追踪到[NSManagedObject valueForKey:]
方法中使用cellForRowAtIndexPath
方法的地方。该应用程序与[NSManagedObject valueForUndefinedKey:]
异常崩溃。使用valueForUndefinedKey启动时应用程序崩溃
1000多台设备中只有一台设备如何才能解决这个问题?运行相同版本的iOS和应用程序,我无法在我的任何设备中模拟它。出了什么问题?
Last Exception Backtrace:
0 CoreFoundation 0x3549e88f __exceptionPreprocess + 163
1 libobjc.A.dylib 0x368c5259 objc_exception_throw + 33
2 CoreFoundation 0x3549e5c5 -[NSException init] + 1
3 CoreData 0x329d3b23 -[NSManagedObject valueForUndefinedKey:] + 327
4 Foundation 0x312b59d1 _NSGetUsingKeyValueGetter + 125
5 CoreData 0x3298d995 -[NSManagedObject valueForKey:] + 121
6 MyApp 0x0000c513 -[Activity isOn:] (Activity.m:371)
7 MyApp 0x0000beaf -[Activity firstMarkableDate] (Activity.m:163)
8 MyApp 0x0000c0cb -[Activity statusString] (Activity.m:220)
9 MyApp 0x0000bd51 -[Activity statusColor] (Activity.m:139)
10 MyApp 0x00004af1 -[ActivityListViewController tableView:cellForRowAtIndexPath:] (ActivityListViewController.m:418)
11 UIKit 0x3251d0a3 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 547
你有没有在任何时候更新你的应用程序?换句话说,它可能是核心数据模型中的版本更改吗? – Till 2012-03-19 13:27:51
应用程序的核心数据模式在任何udpates中都没有改变。并且相同的应用程序版本可以在我们的每个设备(非开发设备)上完美运行 – Anand 2012-03-19 13:35:07
您必须看看您的'Activity',它似乎没有实现'-isOn:'(注意冒号)。 – 2012-03-19 13:39:06