我想写一个textField值,它是一个名为login.txt的文件的用户名。WriteToFile:自动弃用警告
我的代码:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
// the path to write file
loginFilePath= [documentsDirectory stringByAppendingPathComponent:@"Login.txt"];
NSString *userName=[nameText text];
[userName writeToFile:loginFilePath atomically:YES];
我得到的警告, “wrtieToFile:原子:” 已被弃用。
Look [here](https://developer.apple.com/library/IOs/#documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/DeprecationAppendix/AppendixADeprecatedAPI.html) – 2012-02-03 07:03:35