开发者

how to show table in editing mode in iphone?

in app i have custom tableview which subclass of uiviewcontroller & i want to show editing in tableview when i show self.navigationItem.rightBarButtonItem =开发者_开发技巧 self.editButtonItem; when i clicked on it the tableview doesn't show red minus sign. where i was wrong & what i do for come out from it?


You can use self.editButtonItem; only : in case your class is a subclass of UITableViewController sub class .

In case of UIViewController sub class self.editBarButtonItem does not work.

In this case you can use

self.navigationItem.rightBarButtonItem=[[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemEdit target:self action:@selector(edit:)] autorelease];

and in edit method set editing

-(void)edit:(id)sender { myTable.editing=YES; }

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜