采用核心数据创建我的仪表。
I have a viewcontroller with an object i want to save that object to my FavoriteViewController. By clicking a button favorite I want my object to be save into the managedObjectContext but I m getting the following error:
www.un.org/Depts/DGACM/index_spanish.htm 因无一例外而终止妊娠 试图以已经进展的手法开展另一项行动。 *。
我的法典:
// Step 1: Create Object
Favorite * newFavorite = (Favorite*)[NSEntityDescription insertNewObjectForEntityForName:@"Favorite" inManagedObjectContext:managedObjectContext];
// Step 2: Set Properties
newFavorite.name = @"Company";
NSLog(@"%@",newFavorite);
// Step 3: Save Object
NSError *error = nil;
if (![newFavorite.managedObjectContext save:&error]) { // this is where the program crash
NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
abort();
}
我不敢肯定我干什么错了。