该代码被称为按钮点击事件ClassA的VC:
ClassBVC* bVc = [[ClassBVC alloc] initWithNibName:@"ClassBVC" bundle:nil];
UINavigationController* tempNavCon = [[UINavigationController alloc] initWithRootViewController:bVc];
[self presentModalViewController:tempNavCon animated:YES];
[tempNavCon release];
[bVc release];
bVc = nil
;
,并在课堂上BVC鉴于没有加载您做出UIbarbutton项目如:
UIBarButtonItem* barButton = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStylePlain target:self action:@selector(backButtonClicked:)];
[barButton setTitle:@"Back"];
[self.navigationItem setLeftBarButtonItem:barButton];
[barButton release];
而且在buttonClickedMethod简单地忽视了模型控制器:
-(void)backButtonClicked:(id)sender
{
[self dismissModalViewControllerAnimated:YES];
}
self.navigationItem.rightBarButtonItem = self.editButtonItem; 这是显示EditButton项目,现在如何调用Tableview的编辑方法 – iProgrammer 2011-05-19 11:00:13
确定与编辑和完成button.And删除记录,但它正在删除临时工作正常。当重新开始我的应用程序,然后记录仍然存在 – iProgrammer 2011-05-19 11:05:16
- (空)的tableView:(UITableView的*)atableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { 如果(editingStyle == UITableViewCellEditingStyleDelete){ [书签removeObjectAtIndex: indexPath.row]; [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath,nil] withRowAnimation:UITableViewRowAnimationFade]; [[NSUserDefaults standardUserDefaults] setObject:bookmarks forKey:@“Bookmarks”]; } } – iProgrammer 2011-05-19 11:06:22