I’m working with UITableView in UIViewController..I am using the following delegate methods…..
-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
-(UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
Once I load the view I find all delegates has been called….. But I need to call these methods in a button click…..
I tried in this way….
[self tableView:table numberOfRowsInSection:rows];
[self tableView:table cellForRowAtIndexPath:path];
I find that these methods has been called,but nothing happened (code inside these delegates doesn’t works)…. I don’t knw why??? Any suggestions???
Write the code inside the button click function it will call all the delegates of the tableview
or complete code to your solution is:-
Try this it will work..