I am new to Objective-C and trying to create custom cells. In the storyboard (under Xcode 4.2), I click on the TableViewController. In this controller, I show some simple cells, but now I want to configure them. (In older versions of Xcode, I used something like this:
if (cell == nil) { NSArray * topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"MyNib" owner:nil options:nil]; for(id currentObject in topLevelObjects) { if([currentObject isKindOfClass: [UITableViewCell class]]) { cell = (detailViewCell *) currentObject; break; } } }
to load my custom cells, but now it no longer works because I get an error that the Nibfile "MyNib" was not found, of course ... because I am using a storyboard .. but how can I fix that? How to load CustomCell from a storyboard?
EDIT: "Haha, I'm such an idiot ... solved the problem on my own.
static NSString *CellIdentifier = @"detailsViewCell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
I thought that these lines create a new standard cell with the identifier "detailViewCell", so I have not changed it to my custom cell identifier yet, but yes, instead they load the created custom cell. :) now everything works fine! :) "
source share