iOS UIlabel 遇到\n 换行

NSString *msg; msg = [NSString stringWithFormat:@"%@",
[[[DATA.specificSearchList objectAtIndex:indexPath.row]objectForKey:@"content"] stringByReplacingOccurrencesOfString:@"\\n" withString:@" \r\n" ]];
label.numberOfLines = 0; //不要忘记设置这个label.text = msg;

你可能感兴趣的:(iOS UIlabel 遇到\n 换行)