我只是尝试了这个:
NSString *docPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Docs/data.txt"];
NSString *dataFile = [NSString stringWithContentsOfFile:docPath usedEncoding:NSUTF8StringEncoding error:NULL];
使用这个,我有这个警告:
不兼容的整数到指针转换将“int”发送到“NSStringEncoding *”类型的参数(又名“unsigned int *”);
怎么了?