テーブル ビューでラベルを割り当てましたが、ラベルのテキストが長すぎると次の行に折り返されません。
私のコードは次のとおりです。
UILabel *food_lbl=[[UILabel alloc]init];
foodspe = [NSString stringWithFormat:@"%@",[[NSUserDefaults standardUserDefaults]valueForKey:@"food"]];
foodspe = [foodspe stringByReplacingOccurrencesOfString:@"(" withString:@""];
foodspe = [foodspe stringByReplacingOccurrencesOfString:@")" withString:@""];
foodspe = [foodspe stringByReplacingOccurrencesOfString:@"\n" withString:@""];
foodspe = [foodspe stringByReplacingOccurrencesOfString:@" " withString:@""];
food_lbl.text = foodspe;
food_lbl.numberOfLines=2;
food_lbl.lineBreakMode=UILineBreakModeWordWrap;
[food_lbl setFrame:CGRectMake(100, 0, 150, 100)];
[food_lbl setFont:[UIFont boldSystemFontOfSize:25.0f]];
[cell.contentView addSubview:header];
例えばfood_lbl
_paneer,panjabi,pasta,pizza,Puff,chocolates