我在XML上显示UILABEL上的文字,我在文本中得到了CRLF。所以我无法为我的标签添加新行。这是我试过的代码。但是我没有得到 请教我这个
NSArray* array = [subHead.Description componentsSeparatedByString:@"\r\n"];
NSLog(@"Count : %d",[array count]);
for(int i=0;i<[array count];i++)
{
NSLog(@"%@",[array objectAtIndex:i]);
NSString* s = [NSString stringWithFormat:@"%@",[array objectAtIndex:i]];
// s = [s stringByTrimmingCharactersInSet:[NSCharacterSet controlCharacterSet]];
if ([s length]>0){
[str appendString:[array objectAtIndex:i]];
[str appendString:@"\r\n"];flag++;
}else {
NSLog(@"Two \n\'s are occured");
}
NSLog(@"Flag value : %d",flag);
}
NSLog(@"String : %@",str);
NSLog(@"Description : %@",subHead.Description);
subheadlabel.text=str;
感谢提前
答案 0 :(得分:0)