开发者

iphone objective-c interesting problem with accessory and setEditing

In my DetailViewController i have the code

UPDATED x2

This is my setEditing

- (void)setEditing:(BOOL)editing animated:(BOOL)animated {
    [super setEditing:editing animated:animated];
    [tableView setEditing:editing animated:YES];  //this line was added to force editing Mode
....

In my detailViewController I want to send tableView the 'magic/whatever it is' to register 'editing mode' to change the accessory, but I dont want to bring up the delete buttons. Previousl开发者_如何学运维y I didnt have the line [tableView setEditing:editing animated:YES];, and so I only want it to bring up the accessory.


You should definitely fix this.

When you create the table view cell (in tableView:cellForRowAtIndexPath:), set the accessoryType property to UITableViewCellAccessoryNone and the editingAccessoryType property to UITableViewCellAccessoryDisclosureIndicator.

You do this instead of implementing the deprecated tableView:accessoryTypeForRowWithIndexPath: method.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜