标签:
//怎么将字符串中的每一个字符存入数组中
NSString *textString=@"中华人民共和国";
NSMutableArray *stringArray = [[NSMutableArray alloc] init];
for (int i = 0; i < textString.length; i ++) {
NSRange range;
range.location = i;
range.length = 1;
NSString *tempString = [textString substringWithRange:range];
[stringArray addObject:tempString];
}
//竖直显示字符串
NSString *amutstr=[stringArray componentsJoinedByString:@"\n"];
self.StoryTitleLabel.text=amutstr;
self.StoryTitleLabel.numberOfLines=textString.length;
下面效果:
标签:
原文地址:http://www.cnblogs.com/huangzs/p/4648537.html