What's the fastest way to determine if a file adheres to a particular class's NSCoding implementatio

Posted by Justin Searls on Stack Overflow See other posts from Stack Overflow or by Justin Searls
Published on 2010-03-21T15:54:01Z Indexed on 2010/03/21 16:01 UTC
Read the original article Hit count: 353

Filed under:
|
|

Given: An application that accesses a directory of files: some plain text, some binary files that adhere to a particular NSCoding implementation, and perhaps other binary files it simply doesn't understand how to process.

I want to be able to figure out which of the files in that directory adhere to my NSCoding class, and I'd prefer not to have to fall back on the naïve approach of loading the entirety of each file into memory, attempting to unarchive each.

Anyone have an elegant approach or pattern to this problem?

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about iphone