¡@

Home 

2014/10/15 ¤U¤È 10:08:59

iphone Programming Glossary: fileatpath

Writing and reading text files on the iPhone

http://stackoverflow.com/questions/4964274/writing-and-reading-text-files-on-the-iphone

NSDocumentDirectory NSUserDomainMask YES objectAtIndex 0 NSString fileName @ myTextFile.txt NSString fileAtPath filePath stringByAppendingPathComponent fileName if NSFileManager defaultManager fileExistsAtPath fileAtPath NSFileManager.. NSString fileAtPath filePath stringByAppendingPathComponent fileName if NSFileManager defaultManager fileExistsAtPath fileAtPath NSFileManager defaultManager createFileAtPath fileAtPath contents nil attributes nil The main act... aString dataUsingEncoding.. fileName if NSFileManager defaultManager fileExistsAtPath fileAtPath NSFileManager defaultManager createFileAtPath fileAtPath contents nil attributes nil The main act... aString dataUsingEncoding NSUTF8StringEncoding writeToFile fileAtPath atomically..