該代碼被稱爲按鈕點擊事件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