Мне удалось найти решение ... оно не так сложно, как я думал
- (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath {
Favorites *favorite = [fetchedResultsController objectAtIndexPath:indexPath];
cell.textLabel.text = favorite.name;
NSLog(@"%d",[favorite.name length]);
NSLog(@"%@",favorite.name);
if ([favorite.name length] <= 34) {
cell.textLabel.numberOfLines = 1;
NSLog(@"no. of lines = 1");
}else{
cell.textLabel.numberOfLines = 2;
NSLog(@"no. of lines = 2");
}
cell.detailTextLabel.text = favorite.subTopic;}
В моем - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
вызывается метод
configureCell
В основном я проверяю количество символов в строке. Я нашел магическое число, состоящее из 34 символов, так что все подходит.