【发布时间】:2015-05-27 09:44:36
【问题描述】:
我正在尝试将值插入核心数据对象,但在保存这些值的同时收到null 响应,但它正在更新到核心数据数据库中,
使用代码:
AllAssets *allAssets1 = [NSEntityDescription insertNewObjectForEntityForName:@"AllAssets" inManagedObjectContext:context];
allAssets1.assetID = [NSNumber numberWithInt:assetID];
allAssets1.originalassetname = assetName;
[images addObject:[showrelatedAssets objectAtIndex:i]];
[products addObject:allAssets1];
[show_AddtoOffline addRel_Assets:products];
从NSLog 语句下方获取null,
if ([images count] !=0 ) {
if ([context save:&error])
{
NSLog(@"Can't Save! %@ %@", error, [error localizedDescription]);
}
}
【问题讨论】:
标签: ios objective-c core-data