NSPropertyListSerialization weirdness
NSPropertyListSerialization weirdness
- Subject: NSPropertyListSerialization weirdness
- From: Robert Martin <email@hidden>
- Date: Sun, 26 Jul 2015 17:28:48 -0400
I’m having some issues. I’m tracking a folder that is I watch via kqueue, and if a .plist arrives, I process it immediately. The plist contains a dictionary, which is successfully read with dictionaryWithContentsOfFile:. If I log the dictionary description, it is accurate. The dictionary only contains strings, arrays of string, NSNumbers, or NSDates.
Though I can guarantee that the plist is well formed when it’s sent, if I try to serialize it with:
NSData* plist = [NSPropertyListSerialization dataWithPropertyList:updateDictionary];
I get a null, and an error (200) that the plist contains null.
Before I make that call, I put in a check for nulls, but none are found:
[updateDictionary enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
if( obj == nil ){
*stop = YES;
NSLog( @"nil obj for key: %@", key );
}
*stop = NO;
}];
I cannot understand how a dictionary which contains no nulls and only valid classes can generate the NSPropertyListSerialization error. Any ideas?
Rob
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden