NSFileHandle continues read

Hello,

I would like to read the contents of a log file and continue reading it and displaying the output to a NSTextView until I see a word I'm looking for, then I would like to close the file handle. Is there a way to do this in a block?


Thanks,

Charles

Replies

It’s hard to offer concrete advice here without more details:

  • How big is this log file? Clearly that’s going to vary, but a rough estimate is always helpful.

  • What’s the format like? Is it a text file? Or does it have structure?

  • Which bit are you stuck on? Reading a file with

    NSFileHandle
    ? Or look through the read results to find the delimiter?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"