码迷,mamicode.com
首页 > 其他好文 > 详细

读取txt文件

时间:2014-11-24 18:38:16      阅读:134      评论:0      收藏:0      [点我收藏+]

标签:style   color   sp   for   文件   on   bs   ad   ef   

 UITextView *textView = [[UITextView alloc]initWithFrame:CGRectMake(0, 100, 320, 200)];
    textView.backgroundColor = [UIColor redColor];
    textView.textAlignment=NSTextAlignmentLeft;
    NSString * str = [NSString stringWithContentsOfFile:[[NSBundle mainBundle]pathForResource:@"脑筋急转弯" ofType:@"txt"] encoding:NSUTF8StringEncoding error:nil];
    textView.text = str;
    [self.view addSubview:textView];

读取txt文件

标签:style   color   sp   for   文件   on   bs   ad   ef   

原文地址:http://www.cnblogs.com/zhibin/p/4119016.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!