• 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: Serializing NSDictionary for network transfer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Serializing NSDictionary for network transfer


  • Subject: Re: Serializing NSDictionary for network transfer
  • From: SevenBits <email@hidden>
  • Date: Wed, 07 May 2014 15:07:20 -0400

On Wednesday, May 7, 2014, Carl Hoefs <email@hidden>
wrote:

>
> On May 7, 2014, at 11:38 AM, Wim Lewis <email@hidden <javascript:;>>
> wrote:
>
> > Depending on what is *in* your NSDictionary, though, a less opaque
> serialization format might be better, such as one of the property-list
> formats (see NSPropertyListSerialization) or even JSON. These formats can
> only hold a small, non-extensible set of types, and can't encode recursive
> structures or preserve the sharedness of parts of the object graph, but
> have the significant advantage that they are easier to inspect and are
> easier to keep decoupled from implementation details of your app.
>
> I realize I have a ways to go before I grok Cocoa, as I still approach
> things from the minimalist Linux perspective. It's a simple NSDictionary
> with a few strings and numbers in it, so maybe (for the moment) the JSON
> approach might get me going, then I can revisit the issue with a more
> general Cocoa solution.


That will work only as long the types in the NSDictionary are textual types
representable in JSON, as previously stated. If even one element is not,
the archiving will fail. I prefer to archive to binary data because usually
the user never has to read the serialized data in its raw form, plus it
avoids the disadvantages of non-extensibility and no recursion.


>
> Thanks!
> -Carl
>
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden <javascript:;>)
>
> 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 <javascript:;>
_______________________________________________

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: 
 >Serializing NSDictionary for network transfer (From: Carl Hoefs <email@hidden>)
 >Re: Serializing NSDictionary for network transfer (From: Wim Lewis <email@hidden>)
 >Re: Serializing NSDictionary for network transfer (From: Carl Hoefs <email@hidden>)

  • Prev by Date: Re: Serializing NSDictionary for network transfer
  • Next by Date: Subclassing and private methods
  • Previous by thread: Re: Serializing NSDictionary for network transfer
  • Next by thread: Re: Serializing NSDictionary for network transfer
  • Index(es):
    • Date
    • Thread