Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I just spent many hours pulling my hair out trying to figure out why a <code>UITableView</code> wouldn't show up when when I had it embedded in a separate nib instead of in the main nib. I finally found your discussion above and realized that it was because my <code>UITableViewController</code> wasn't being retained! Apparently the delegate and datasource properties of <code>UITableView</code> are not marked "retain" and so my nib was loading but the controller was getting tossed... And due to the wonders of objective-c I got <em>no</em> error messages at all from this... I still don't understand why it didn't crash. I know that I've seen "message sent to released xxx" before... why wasn't it giving me one of those?!?</p> <p>I think most developers would assume that structure that they build in an interface builder would be held in some larger context (the Nib) and not subject to release. I guess I know why they do this.. so that the iPhone can drop and reload parts of the nib on low memory. But man, that was hard to figure out.</p> <p>Can someone tell me where I should have read about that behavior in the docs?</p> <p>Also - about hooking up the view. First, if you drag one in from the UI builder you'll see that they hook up the view property (which is an <code>IBOutlet</code>) to the table view. It's not necessary to expose the <code>tableView</code>, that seems to get set internally. In fact it doesn't even seem to be necessary to set the view unless you want <code>viewDidLoad</code> notification. I've just broken the view connection between my <code>uitableview</code> and <code>uitableviewcontroller</code> (only delegate and datasource set) and it's apparently working fine.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload