| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
What I'm trying to do is read from a plain text file containing 50 characters per line, and this, one line at a time...
First of all, am I doing this correctly when opening my file?
NSString *filePath= @"~/database.txt";
NSMutableString *fileContents= [[NSMutableString alloc] initWithString: @""];
NSFileHandle *theFile;
theFile = [NSFileHandle fileHandleForReadingAtPath: filePath];
[fileContents initWithCString:[theFile readDataToEndOfFile]];
definitely does not work...
How would I read a 50 character lines?
Finally, to close the file... is the following correct?
[theFile closeFile];
| References: | |
| >[Newbie] Basic file handling questions... (From: Martin-Luc Girard <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.