This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When I posted this on Apple’s Cocoadev listserver, I never did get pointers to code to convert a NSDictionary to a binary formatted plist, but did get pointers to look at NSPropertyListSerialization - something I had already (mis)read a few times. | |
The description for the dataFromPropertyList class method seems confusing if you don't understand that you can create a property list with no keys: that is, you can create one with a single compliant object, and the key becomes "root". | |
So, in the unlikely event that some else someday has the same mental block, here is actual tested code that takes a NSDictionary and creates a binary plist file: | |
NSDictionary *dict; | |
char *payload = "This is the payload"; | |
dict = [NSDictionary dictionaryWithObjectsAndKeys: |