samedi 30 août 2014

What I am missing to make my custom UITableView cell work?


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 enter image description here


enter image description here


For some reason though, what I get on the table is the default style


enter image description here



asked 41 secs ago

Alon_T

284






What I am missing to make my custom UITableView cell work?

Aucun commentaire:

Enregistrer un commentaire