谁能告诉我下面代码的功能。是代码行
NSString* fileName = @"text.txt"; 用于从系统中的某个位置读取文件?
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSString* fileName = @"text.txt";
NSString *fileString = [NSString stringWithContentsOfFile: fileName];
NSArray *lines = [fileString componentsSeparatedByString:@"\n"];
[pool drain];
return 0;
}发布于 2011-05-19 18:50:46
NSString *路径=[资源的NSBundle mainBundle路径:@“文本”txt类型:@“txt”];
https://stackoverflow.com/questions/6057329
复制相似问题