读取文件

    NSBundle *mainBundle=[NSBundle mainBundle];
    
    NSString * txtPath=[mainBundle pathForResource:@"badytype_index" ofType:@"txt"];
    NSString *result=[[NSString alloc] initWithContentsOfFile:txtPath encoding:NSUTF8StringEncoding error:nil];
posted @ 2013-01-23 11:33  天纯蓝  阅读(147)  评论(0编辑  收藏  举报