Created
November 12, 2013 18:14
-
-
Save peerasak-u/7435921 to your computer and use it in GitHub Desktop.
Read / Write File in NSFoundation Framework
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
| NSString *documentsDirectory = [paths objectAtIndex:0]; | |
| NSString *filePath = [documentsDirectory stringByAppendingPathComponent:FILE_NAME]; | |
| myArray = [NSArray arrayWithContentsOfFile:filePath]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
| NSString *documentsDirectory = [paths objectAtIndex:0]; | |
| NSString *filePath = [documentsDirectory stringByAppendingPathComponent:FILE_NAME]; | |
| [myArray writeToFile:filePath atomically:YES]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment