Re: NSPropertyListSerialization weirdness
Re: NSPropertyListSerialization weirdness
- Subject: Re: NSPropertyListSerialization weirdness
- From: "Gary L. Wade" <email@hidden>
- Date: Sun, 26 Jul 2015 19:31:12 -0700
When the file arrives, verify that the contents of it have also arrived. It's possible you may just be processing that a file was created but nothing yet has been put into it.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/
> On Jul 26, 2015, at 2:28 PM, Robert Martin <email@hidden> wrote:
>
> 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