Wednesday, January 19, 2011

iOS Dev Tip: TextWrangler reads binary Plists

TextWrangler is the awesome free text editor from Bare Bones Software, the makers of the widely used Mac text editor BBEdit. I mostly use Xcode and Eclipse for editing code these days, I keep TextWrangler in my dock for lots of miscellaneous text editing needs. Today I found one more great reason to have it.

If you use the NSCoding protocol on your model classes to create NSKeyedArchiver archives, you know that NSKeyedArchiver uses some strange binary format by default. If you try to examine an archive file, you'll see a lot of binary gibberish starting with "bplist00". This is actually a binary version of Apple's common XML Plist file format.

Archive files aren't exactly easy to grok since they contain a lot of meta-data like the classes of objects in the archive and the relationships between objects, but being able to look at the XML can sometimes be a big help when debugging.  And TextWrangler automatically does the right thing with them.

TextWrangler is available in the Mac App Store and I highly recommend it.

No comments: