私は最初のアプリケーションを開発していて、実際のデバイスでそれをテストする時が来ました。私はオフィスに古いiPhone3GSを持っていて、それを最新バージョンのIOSにアップデートしました。
iPhoneシミュレーターでアプリケーションを起動しようとすると、すべてがうまく機能します。しかし、その後、デバイスで起動しようとすると、アプリケーションが次のエラーでクラッシュします。
2012-09-13 14:16:01.556 MyFirstApp[1702:707] *** Terminating app due to uncaught
exception 'NSUnknownKeyException', reason: '[<__NSCFString 0x15e2e0> valueForUndefinedKey:]:
this class is not key value coding-compliant for the key testKey.'
ビルド設定を確認しました。以下のとおりです。
また、IBで適切に設定または削除されていないいくつかの変数から発生する可能性があると聞きましたが、それについての警告はありません...
エラーに関係するビューで使用しているコードは次のとおりです。
@implementation HomeViewController {
@private
NSArray *_orders;
__strong UIActivityIndicatorView *_activityIndicatorView;
}
@synthesize orderList = _orderList;
- (void)reload:(id)sender {
[_activityIndicatorView startAnimating];
[Order orderListWithBlock:^(NSArray *orders) {
if (orders) {
_orders = orders;
[self.orderList reloadData];
}
[_activityIndicatorView stopAnimating];
}];
}
- (void)viewDidLoad
{
[self reload:nil];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Custom Cell Segment";
static NSString *OtherCellIdentifier = @"Other Cell Segment";
Order *o = [_orders objectAtIndex:indexPath.row];
if ([o.testKey isEqualToString:@""]) {
[SOME STUFF]
}
else {
[SOME OTHER STUFF]
}
}
エラーがどこから発生する可能性があるかを誰かが知っていますか?
ご協力いただきありがとうございます !