Contents of static table cells disappears in the build

Originator:synemitchell
Number:rdar://26212029 Date Originated:5/10/2016
Status:Submitted Resolved:
Product:XCode Product Version:7.2.1
Classification:UI/Usability Reproducible:Always
 
When building an app with content inside static table cells, the content appears fine when viewed in Interface Builder, but does not show up in the actual build of the app.

Repro steps: Create a table view and set the content to "Static Cells". Put a label and a text field into the static cell. All looks well in Interface Builder. Build the app. Viola! The static table cells disappear in the build.  (see attached screenshot)

The fix for this is to delete the following two functions that are inserted by default into a new UITableViewController file:

    override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        // #warning Incomplete implementation, return the number of sections
        return 0
    }

    override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        // #warning Incomplete implementation, return the number of rows
        return 0
    }

This is non-intuitive. I would expect one of the following things to happen:

1) Content would show up.
2) XCode would automatically remove those functions from the template when I applied the class to a table view with static fields.
2) I'd get a build error or warning telling me to delete those two functions.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!