UILineBreakModeWordWrap doesn’t work with UITableViewCellStyleValue2. Please see my screenshot.
- (UITableViewCell *)tableView:(UITableView *)tableView_ cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView_ dequeueReusableCellWithIdentifier:@"any-cell"];
if(cell == nil)
{
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:@"any-cell"] autorelease];
}
cell.textLabel.text = @"Address";
cell.textLabel.lineBreakMode = UILineBreakModeWordWrap;
cell.textLabel.numberOfLines = 0;
cell.detailTextLabel.text = @"1838 East Wardlow St (Corner of Cherry & Wardlow)";
cell.detailTextLabel.lineBreakMode = UILineBreakModeWordWrap;
cell.detailTextLabel.numberOfLines = 0;
return cell;
}
Result:

Do you have any solutions?
The
UILineBreakModeWordWrapdoes actually work seeing your screenshot.What’s happening is that the height of your UITableViewCell is not big enough.
You can calculate the needed height and set it in the
tableView:heightForRowAtIndexPath:method of the TableView’s delegate like so: