iPhone Storyboard Editing a table view

前端 未结 7 1385
囚心锁ツ
囚心锁ツ 2021-02-06 04:15

I\'ve been trying to learn the new Storyboard feature in Xcode and I\'ve run into a problem with trying to set a UITableView to edit mode.

So far my storyboard looks lik

7条回答
  •  名媛妹妹
    2021-02-06 05:07

    I think that also with Storyboard, the only way (for sure, the easiest one) to implement a working edit/done button, is to use the following code:

    - (void)viewDidLoad
    {
    [super viewDidLoad];
    ...
    //set the edit button
    self.navigationItem.leftBarButtonItem = self.editButtonItem;
    ...
    

    This is the solution that Apple itself implements if you select a "Master-Detail Application" template for your project.

    Probably Storyboard is still not perfect, and hopefully it will be improved from Apple in next releases...

提交回复
热议问题