I have a problem with displaying information in a cell, left and right. I know using initWithStyles UITableViewCellStyleSubtitle. I use this, but it does not work.
Here is a sample code:
- (UITableViewCell *)tableView:(UITableView *)ltableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Account Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:Cellidentifier];
}
Accounts *account = [self.fetchedResultsController objectAtIndexPath];
cell.textLabel.text = account.name;
cell.detailTextLabel.text = @"Price";
return cell;
}
I can show cell.textLabel.text just fine, however I cannot get a simple "price" to be displayed. I tried various things like setting the font size cell.detailTextLabel.
I also tried UITableViewCellStyleValue1, as some suggested in older posts. Threw NSLog after setting to "Price", shows cell.detailTextLabel as null.
Not sure what I'm doing wrong.
Edit: I found this: cell.detailTextLabel.text NULL
if (cell == nil), ...
, ?