• 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
NSPropertyListSerialization weirdness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSPropertyListSerialization weirdness
      • From: "Gary L. Wade" <email@hidden>
    • Re: NSPropertyListSerialization weirdness
      • From: Jens Alfke <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>)

  • Prev by Date: Updating a screensaver from 10.6 to 10.10
  • Next by Date: Re: NSPropertyListSerialization weirdness
  • Previous by thread: Re: NSTableView - kill the blue (Obj-C)
  • Next by thread: Re: NSPropertyListSerialization weirdness
  • Index(es):
    • Date
    • Thread