就 NSString 而言,是否有限制?我正在使用以下代码行来读取文件的内容,edit.txt
但saveString
无法包含我的.txt
文件的所有内容。
NSString *savedDir = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
//NSString *savedeDir = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSString *saveFilePath = [savedDir stringByAppendingPathComponent:@"Root"];
saveFilePath = [saveFilePath stringByAppendingPathComponent:savedName];
saveFilePath = [saveFilePath stringByAppendingPathComponent:@"edit.txt"];
NSString *saveString = [NSString stringWithContentsOfFile:saveFilePath encoding:NSUTF8StringEncoding error:nil];
NSLog(@"saveString is :: %@ savedSpaceName : %@ savefilepath : %@ ", saveString, savedName, saveFilePath);
NSString 的大小有问题吗?我无法弄清楚。有人可以为我提供解释或帮助我弄清楚。谢谢并恭祝安康。