我在我的應用程序中使用核心數據。當我用[context deleteObject:obj]
刪除對象時,只有空字段纔會刪除對象。我如何永久刪除對象?先謝謝了。我使用表視圖,並且當這個視圖充滿來自核心數據的數據時,有空行被刪除的對象。這是代碼:核心數據刪除對象
LNAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
self.context = [appDelegate managedObjectContext];
self.accounts = [[NSArray alloc] init];
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription
entityForName:@"Accounts" inManagedObjectContext:self.context];
[fetchRequest setEntity:entity];
NSError *error;
self.accounts = [self.context executeFetchRequest:fetchRequest error:&error];
你是什麼意思,只有空領域?你用什麼樣的UI來顯示這些對象?這裏需要更多的信息。 – 2012-01-03 23:31:30
我編輯我的文章。 – 2012-01-03 23:36:47
您是否使用提取的結果控制器來處理填充/更新表視圖? – 2012-01-03 23:41:02