I am having trouble displaying data in my table.
Preamble:
- TableView placed on the storyboard
- TableView linked to a
@property (strong, nonatomic) IBOutlet UITableView *myTable; .mfile contains both required methods and content to be displayed- Controller conforms to
<UITableViewDataSource>
I suspect i am not setting up the dataSource in the right place. Where in a UIViewController should it be set, when initialization happens from the StoryBoard? I placed it in the -(void)viewWillAppear:(BOOL)animated, however DataSource was not set. Same goes for init.
[myTable setDataSource:self];
If the view is loaded with the help of storyboard (initialization does not happen as part of init method) .. where should table’s dataSource be set?
The controller’s
-viewDidLoadmethod would be a good option. That method is meant to perform any initialization that has to be deferred until the view is loaded.I’m not sure what you mean by ‘did not take.’ Is the table’s data source not set to your controller?