1
我試圖設置一個UITableView,我可以編輯。我有以下方法實施:可編輯的UITableView
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
但我不知道如何將編輯鏈接到我的UINavigationBar中的編輯按鈕。這是我的按鈕項目:
UIBarButtonItem * leftButton = [[UIBarButtonItem alloc] initWithTitle:@"Edit"
style:UIBarButtonSystemItemEdit
target:nil
action:@selector(editButtonSelected:)];
我該如何得到這個工作?
但是那麼我的editButtonSelected方法應該是什麼樣子? – CodeGuy 2011-02-05 21:07:59