• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSPropertyListSerialization weirdness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSTableView - kill the blue (Obj-C) (From: 2551 <email@hidden>)
 >Re: NSTableView - kill the blue (Obj-C) (From: Ken Thomases <email@hidden>)
 >NSPropertyListSerialization weirdness (From: Robert Martin <email@hidden>)

  • Prev by Date: Re: CGFloat and literal floats in Swift
  • Next by Date: Re: CGFloat and literal floats in Swift
  • Previous by thread: Re: NSPropertyListSerialization weirdness
  • Next by thread: Updating a screensaver from 10.6 to 10.10
  • Index(es):
    • Date
    • Thread