我正在尝试将现有数据从本地商店播种到启用 iCloud 的商店。当我尝试从本地托管对象访问关系对象时,会引发以下异常,
> illegal attempt to establish a relationship between objects in
> different contexts
这就是我想要做的..
NSEntityDescription *entity = [recurringExpense entity];
RecurringExpense *newRecExpense = [[RecurringExpense alloc]initWithEntity:entity insertIntoManagedObjectContext:moc];
newRecExpense.category = recurringExpense.category;
[moc assignObject:newRecExpense toPersistentStore:store];
提前致谢。