Reputation: 1289
I have created a grouped table view & I had a edit button in the title bar & I can able to navigate to other page on click of every row after pressing edit button
now by using following code I have designed the grouped table view programmatically but now edit button is not working on click of a row (after pressing edit) it's not navigating how can I fix this?
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationItem.rightBarButtonItem = self.editButtonItem;
tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, 320, 415)style:UITableViewStyleGrouped];
tableView.dataSource = self;
[self.view addSubview:tableView];
}
Upvotes: 0
Views: 124
Reputation: 10283
Side note - although developers do often assign the view controller as the datasource and delegate of a UITableView, you may want to consider farming these responsibilities out to another object.
UIViewController subclasses do have a habit of becoming so-called "god" classes, taking on lots of responsibilities (hence violating the Single Responsibility Principle) and also making them difficult to unit test.
Upvotes: 0
Reputation: 26400
@Ruben is right. Set the delegate of the tableView and Implement the UITableViewDelegate
methods
Upvotes: 0