如何解决此问题。 的" (entity:EventDetails; id:0x155ebe90; data :)" 。
我正在使用下面的代码从我的实体中获取事件。
managedObjectContext = [(AppDelegate *)[[UIApplication sharedApplication] delegate] parentContext];
writerObjectContext = [(AppDelegate *)[[UIApplication sharedApplication] delegate] managedObjectContext];
temporaryContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType];
temporaryContext.parentContext = managedObjectContext;
[temporaryContext performBlockAndWait:^{
if (temporaryContext == nil) {
managedObjectContext = [(AppDelegate *)[[UIApplication sharedApplication] delegate] parentContext];
writerObjectContext = [(AppDelegate *)[[UIApplication sharedApplication] delegate] managedObjectContext];
NSManagedObjectContext *temporaryContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType];
temporaryContext.parentContext = managedObjectContext;
}
NSError *error = nil;
NSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:@"EventDetails"];
NSArray *arr = [temporaryContext executeFetchRequest:request error:&error];
NSLog(@" %@", arr);
if (![temporaryContext save:&error]) {
NSLog(@"Error in getsize - error:%@",[error userInfo]);
}
[managedObjectContext performBlockAndWait:^{
NSError *error = nil;
if(![managedObjectContext save:&error])
{
NSLog(@"error");
}
[writerObjectContext performBlockAndWait:^{
NSError *error = nil;
if(![writerObjectContext save:&error])
{
NSLog(@"error");
}
}]; // writer
}]; // main
}]; // parent
我在我的iphone和模拟器上运行上面的代码。但得到相同的结果。如何摆脱这个?
答案 0 :(得分:0)
data: <fault>
(可能来自日志声明)只是意味着Core Data没有从数据库中获取所有相关数据,但如果需要信息,将会自动进入商店。
换句话说,这是正常行为。你不必担心它。