I´ve just got a new Mac and I downloaded Xcode (4.5.1) from Appstore. By default when you create a new project (in my case using the Master/Detail template with Storyboard enabled) it targets ios 6.0 and the project runs fine on my iPhone that has been upgraded to 6.0.
To run it on my iPhone with 5.1.1 I change the Deployment target. Running on 5.1.1 when an item is added and displayed in the UITableView I get the following error:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason:' -[UITableView dequeueReusableCellWithIdentifier:forIndexPath:]:
unrecognized selector sent to instance 0x1023b800'
This is the code that trows the error
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];
NSDate *object = _objects[indexPath.row];
cell.textLabel.text = [object description];
return cell;
}
From my previous iPhone projects I´m used to seeing this below the
if(cell == nil)
// Create the cell
But I assume I don´t need this as the Storyboard already has got a Cell added to the UITableView.
Any tips..?
Best regaards
Øystein
The problem can be found in the [UITableView dequeueReusableCellWithIdentifier:forIndexPath:] documentation;