Reputation: 3240
I got UITableView
in simple view, which controlled by UIViewController
I implement methods like in standard UITableViewController
:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
But it doesnt work. Nothing showes in the table
How can i upload the data to this UITableView?
Upvotes: 0
Views: 843
Reputation: 171
UITableView
to point to your UIViewController
? <UITableViewDataSource>
protocol, in this way you will receive some warning if you missed to implement some required method. Are you trying to use an UIViewController
in place of a UITableViewController
? Why? (As Damien said, this should be the first question).
Upvotes: 3
Reputation: 1048
Sorry if this is a dumb question, but why not use the actual UITableViewController? You can embed it in a UIViewController and make it smaller if you want (like the iOS "Stocks" app from Apple).
There is a lot going on with tableView, which is why when you create a new UIViewController subclass it asks specifically if you want to subclass UITableViewController or UIViewController. Of course you can get it to work, but a good first question is why not use UITableViewController?
Again sorry if that isn't really answering the question directly.
Good luck,
Damien
Upvotes: 1