Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Enuratique

macrumors 6502
Original poster
Apr 28, 2008
276
0
Hi all,

I've looked high and low for functionality that is similar to System.in.readLine() [in Java] and BufferedReader.ReadLine() [in .NET] in the iPhone SDK. The closest thing I can find is NSString's withContentsOfFile. My intent is to have a text file with one word per line, but reading in the whole file (with about 20,000 words in it) into one string seems needlessly inefficient. But there's no middle ground - I would then have to use NSFileHandle and seek individual bytes until I've reached a newline character or the EOF, whichever comes first. Am I missing something? This seems like a common thing to do.

Thanks!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.