UIlabel 遇到\n 换行-iOS

NSString  *msg;
        msg = [NSString stringWithFormat:@"%@",[[[DATA.specificSearchList objectAtIndex:indexPath.row]objectForKey:@"content"] stringByReplacingOccurrencesOfString:@"\\n" withString:@" \r\n" ]];

label.numberOfLines = 0;        //不要忘记设置这个
label.text = msg; 

 

你可能感兴趣的:(objective-c)