我正在尝试从文本文件中读取文本。我使用 stringWithContentsOfFile 来做到这一点。
pathName = [[NSBundle mainBundle] pathForResource:sample ofType:@"txt"];
entireContent = [NSString stringWithContentsOfFile:pathName encoding:NSUTF8StringEncoding error:NULL];
entireChapter = [entireContent substringWithRange:sourceRange];
你们有没有其他方法可以快速获得字符串?