I have a view hierarchy that has a UIViewController as Files Owner in the XIB.
I need to add a UITableView into the hierarchy that has it's own controller (a UITableViewController subclass) because I am implementing a pull-to-refresh UI using http://github.com/leah/PullToRefresh
What I did:
- created the new UITableViewController subclass,
BuddyTableViewController
- implemented the datasource & delegate methods
- added the UITableView into the hierarchy in Interface Builder
- dropped an NSObject into the XIB and set the class to
BuddyTableViewController
- set the delegate & datasource of the tableview to
BuddyTableViewController
and hooked the UITableView to the tableView property ofBuddyTableViewController
When the view displays it crashes immediately.
When running in debug with NSZombieEnable=YES
reveals the message:
*** -[BuddyTableViewController numberOfSectionsInTableView:]: message sent to deallocated instance 0x69551d0
numberOfSectionsInTableView
only contains return 1;
I don't understand why BuddyTableViewController
is being deallocated.