i actually dont see my error:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *Cel
You're returning friendCell, and it's very likely nil.
Your code looks fine, so make sure you have your Interface Builder file set up right. In FriendTableViewCell.xib, be sure the File's Owner is your table view controller and that you correctly set the cell to be an outlet to friendCell (which I assume is a UITableViewCell).
Do not forget to set cell identifier
in Interface Builder.
I found that this problem came when trying to create my UITableViewCell before initialising my table view:
Here registering the class before creating the tableView will cause the error, placing it after will fix the error.
[tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:bCellIdentifier];
tableView = [[UITableView alloc] initWithFrame:CGRectZero];
tableView.delegate = self;
tableView.dataSource = self;
[self addSubview:tableView];
tableView.keepInsets.equal = KeepRequired(0);
I know this is an old post now but, I have just encountered this error, I found it very strange as the app was in testing so no fresh builds for a few days and it did this, all I did was reboot the phone and it solved it.
Use This ,
UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:kCellID];
I saved few more hours with just this lines.
You are creating a FriendTableViewCell
and then ignoring it and setting it equal to (presumably) an instance variable named friendCell.
I assume that you expect friendCell to be set when calling the loadNibNamed method. It apparently is not being set.
So you've got two problems with this code. First, don't allocate a cell twice.
cell = [[[FriendTableViewCell ....
[[NSBundle mainBundle .....
cell = friendCell;
Obviously, the creation of a new cell and assigning it to cell is useless if you are overwriting it with the second call to assignment to cell.
Second, friendCell is probably nil. Make sure the NIB is set up correctly and has the outlets pointing to the right places.