i have a cell and a NSIntger that counting number of lines in string. example:
case 1:
NSString *string = @"abcde\nfghijk\nlmnopq\nrstu";
NSInteger length = [[string componentsSeparatedByCharactersInSet:
[NSCharacterSet newlineCharacterSet]] count];
cell.detailTextLabel.text = [NSString stringWithFormat:string];
cell.detailTextLabel.numberOfLines = length;
break;
this code is in - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath.
how i can set the cells width by NSIntger length?
If you want to sell the cell height then you have a method call back method of UITableView delegate …
may this will help you.