I have a tableview in my viewcontroller. But i have an error which say that [tableview:numberofrowinsection:]:unrecongized selector sent to instance. Can someone please tell me how cna i solve this.
2 Answers
You need to set the UIViewController as the delegate, and also datasource also you need to implement the necessary methods. if you look in the apple docs they are described there but i think the main ones are:
numberOfSectionsInTableView:tableView:numberOfRows:inSection:- and
tableView:cellForRowAtIndexPath:
in the first one you return the number of sections, usually 1, in the second you return the number of rows for the section( usually the count of the array) and in the final you return the UITableViewCell object with the necessary data put in position.
read the apple docs, and if necessary copy the method names from one of the UITableViewController templates.
hope this helps