CoreData: Deleting object
来源:互联网 发布:歌词中有狼的网络歌曲 编辑:程序博客网 时间:2024/06/03 06:21
1.Adding Edit button on the left of the NavigationBar
- (void)viewDidLoad{ [super viewDidLoad]; // Uncomment the following line to preserve selection between presentations. // self.clearsSelectionOnViewWillAppear = NO; // Uncomment the following line to display an Edit button in the navigation bar for this view controller. self.navigationItem.leftBarButtonItem=self.editButtonItem; //adding editButtonItem. self.navigationItem.rightBarButtonItem =[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(add)];}
2. Delete record from CoreData
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath{ if (editingStyle==UITableViewCellEditingStyleDelete) { NSString *name=((People *)[self.peopleArray objectAtIndex:indexPath.row]).name; [self.context deleteObject: [self.peopleArray objectAtIndex:indexPath.row]]; [self viewDidAppear:YES]; NSError *error; if ([self.context save:&error]) { UIAlertView *alert=[[UIAlertView alloc] initWithTitle:@"Deleted" message:[NSString stringWithFormat:@"Name:%@ has deleted",name] delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert show]; } }}
- CoreData: Deleting object
- Deleting nodes from an XML object in Flex
- CoreData 数据传输对象DTO(data transfer object)
- CoreData 数据传输对象DTO(data transfer object)
- 警告: deleting object of polymorphic class type which has non_virtual destructor
- CoreData
- CoreData
- CoreData
- CoreData
- CoreData
- CoreData
- CoreData
- CoreData
- CoreData
- CoreData
- COREDATA
- CoreData
- CoreData
- 解复用
- use addr2line in android
- Java线程:线程栈模型与线程的变量
- http协议学习
- poj 1002 Java
- CoreData: Deleting object
- 每日一例飞鸽传书2012偷偷来袭
- 一些可以常用的宏定义
- 关于UIWebView和PhoneGap的总结
- 50个c/c++源代码网站(转)谢谢原创
- 无论做哪种演示红色警戒
- 同理qt也一样蜡笔小新
- 【引用】MTK GPIO 相关知识
- android wifi