0

Using XCode 4.5.2 I have created a Master/Detail iOS 6.0 project from template. The generated project already contains disclosure indicator ">" in table cell and detail view opens when table row is tapped. Then:

  1. I added the Search Bar and Search Display Controller above the master table
  2. According to the following problem I added UITableViewCell class registration in MasterViewController's method - (void)viewDidLoad

[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"Cell"];

After this registerClass line is added I run the program in simulator. The disclosure indicator is not shown in table cells and the detail view does not open when the table row is tapped.

I followed the advice here that adds disclosure indicator back but the detail view still does not open when table row is tapped.

What else is needed?

Community
  • 1
  • 1
andrejt
  • 21
  • 3

2 Answers2

0

You could try using dequeueReusableCellWithIdentifier: instead of dequeueReusableCellWithIdentifier:forIndexPath:.
Also, check if tableView:didSelectRowAtIndexPath: is called.

Johannes
  • 325
  • 4
  • 11
0

I found the solution which enables to even get rid of:

     [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"Cell"];

in

- (void)viewDidLoad

Solution is:

UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];

in method

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

diff is: self. which need to be added to Xcode generated template (for Master/Detail).

andrejt
  • 21
  • 3