The detailTextLabel is not displayed out accordingly thought the source is there. The textLable.text is displayed accordingly though.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
// Configure the cell...
if ([[NSUserDefaults standardUserDefaults] objectForKey:@"favouriteListArray"] != nil) {
NSArray *listArray = [NSArray arrayWithArray:[[NSUserDefaults standardUserDefaults] objectForKey:@"favouriteListArray"]];
NSLog(@"listArray:%@", listArray);
NSDictionary *listDic = [listArray objectAtIndex:indexPath.row];
NSLog(@"listDic:%@", listDic);
cell.textLabel.text = [listDic objectForKey:@"Description"];
cell.detailTextLabel.text = [listDic objectForKey:@"Address"];
}
return cell;
}
NSLogs of listDic
listDic:{
Address = myAddress;
Description = myDescription;
}
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
You need to use initWithStyle:UITableViewCellStyleSubtitle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With