我想寫一個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