i'm trying to add a custom cell to a tableView
i've first created a xib file with 2 label "name" & "description" i've linked it to a controller "customCellAchievementController"
it seems that the nib isn't found when i try to create the tableView
any idea where this can fail ?
i've redefine the class of my xib to the controller, i've change the identifier to the one i'm using in the code, i've check if the xib file is in the build phases / copy bundle resources and everything seems good i really don't understand ...
there is my code
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return [achievement count];
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *customCellIdentifier = @"CustomCell";
CustomCellAchievementController *cell = (CustomCellAchievementController *)[tableView dequeueReusableCellWithIdentifier:customCellIdentifier];
if(cell==nil){
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil];
cell = [nib objectAtIndex:0];
}
cell.name.text= [achievement objectAtIndex:indexPath.row];
cell.description.text = [description objectAtIndex:indexPath.row];
return cell;
}