Vote count:
0
Here are the steps I did to create a custom cell
-Created a custom xib file
-Created a class for that custom cell - Facility Result
I could post the code for that class - maybe the fact I created my own constructor for that class is the problem?
-Named my cell identifier facilityResultDesign
on xcode
-Linked the outlets to the class
-Updated the protocol function to run
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
FacilityResult* currentResult = [_facilityResults objectAtIndex:indexPath.row];
UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:@"facilityResultDesign" forIndexPath:indexPath];
if (cell == nil){
[tableView registerNib:[UINib nibWithNibName:@"facilityResult" bundle:nil] forCellReuseIdentifier:@"facilityResultDesign"];
cell = [tableView dequeueReusableCellWithIdentifier:@"facilityResultDesign"]; options:nil];
}
cell.textLabel.text = currentResult.name;
return cell;
}
-Updated ViewDidLoad
- (void)viewDidLoad{
[super viewDidLoad];
[[login getSearchFacility] setDelegate:self];
[_resultTable registerClass:[FacilityResult class] forCellReuseIdentifier:@"facilityResultDesign"];
if(_facilityResults==nil)
_facilityResults = [[NSMutableArray alloc] init];
}
Does anyone know what I might miss?
Thanks
-Here's the xcode
For some reason though, what I get on the table is the default style
asked 41 secs ago
What I am missing to make my custom UITableView cell work?
Aucun commentaire:
Enregistrer un commentaire