I am trying to create a UITableView cell that says “View this devotional online” with a large font. The issue I am having is the text in the cell is not wrapping so I end up with part of the phrase.

The code I have for this is:
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
// Get cell
static NSString *CellIdentifier = @"CellA";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
}
// Display
cell.textLabel.textColor = [UIColor blackColor];
cell.textLabel.font = [UIFont systemFontOfSize:15];
if (item) {
// Item Info
NSString *itemTitle = item.title ? [item.title stringByConvertingHTMLToPlainText] : @"[No Title]";
// Display
switch (indexPath.section) {
case SectionHeader: {
// Header
switch (indexPath.row) {
case SectionHeaderTitle:
cell.textLabel.font = [UIFont boldSystemFontOfSize:15];
cell.textLabel.text = itemTitle;
break;
case SectionHeaderDate:
cell.textLabel.text = dateString ? dateString : @"[No Date]";
break;
case SectionHeaderURL:
cell.textLabel.text = @"View this devotional in full website";
cell.textLabel.textColor = [UIColor blackColor];
cell.textLabel.font = [UIFont systemFontOfSize:36];
cell.imageView.image = [UIImage imageNamed:@"Safari.png"];
cell.textLabel.numberOfLines = 0; // Multiline
break;
}
break;
}
case SectionDetail: {
// Summary
cell.textLabel.text = summaryString;
cell.textLabel.numberOfLines = 0; // Multiline
break;
}
}
}
return cell;
}
The following line worked before, but it doesn’t seem to work here.
cell.textLabel.numberOfLines = 0; // Multiline
Could someone show me how to wrap my text?
In addition to setting
numberOfLinesto zero, set the line break mode:(uncompiled, but you get the idea).