NSString *c = @"aiyukangDSDASDASDASDASDASDASDASDAS";
[c writeToFile:@"/Users/aixiaoxin/Desktop/3.txt" atomically:YES encoding:NSUTF8StringEncoding error:nil];
[@"dasdasdasdas\ndasdasdas\ndasdasdasd\ndasdasdas\n" writeToFile:@"/Users/aixiaoxin/Desktop/3.txt" atomically:NO encoding:NSUTF8StringEncoding error:nil];
NSString *d = [NSString stringWithContentsOfFile:@"/Users/aixiaoxin/Desktop/3.txt"encoding:NSUTF8StringEncoding error:nil];
NSLog(@"%@",d);
我写入了两次字符串 。结果总是显示第二次的。难道这个方法不叠加???直接把我第一次的写入给覆盖了。。 |
|