• 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: Guidelines on using NSJSONSerialization
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Guidelines on using NSJSONSerialization


  • Subject: Re: Guidelines on using NSJSONSerialization
  • From: Alex Zavatone <email@hidden>
  • Date: Thu, 19 Apr 2012 13:01:09 -0400

Yeah, it was the fact that the CLLocationDegrees in the CLLocationCoordinate2D struct were doubles, or that CLLocationCoordinate2D was a struct.

The other possibility might be if the mapView.annotations array  is nil terminated, that might cause the premature death.

Rebuilt the string and recreated the array and it's fine.

Still think that NSJSONSerialization dataWithJSONObject:jAnnotations options:NSJSONWritingPrettyPrinted error:&error should throw an error rather than just crashing.  Seems odd to have the error option there, but not usable.


On Apr 19, 2012, at 10:14 AM, Alex Zavatone wrote:

> I'm wondering if there are any hard and fast basic rules on why an NSDictionary or NSArray would not be pass the [NSJSONSerialization isValidJSONObject: jDict]
> test.
>
> According to the docs, isValidJSONObject:, returns a Boolean value that indicates whether a given object can be converted to JSON data, so I assume I'm using this correctly.
>
> I'm trying to output my mapKit annotation list to a JSON file and I'm rather surprised that the annotation list (even when added to a dictionary key as an object) fails to pass the test.
>
> At this point, unless there's something simple, it will actually be faster to walk the dictionary myself.
>
> Thanks in advance.
>
> - Alex Zavatone
> _______________________________________________
>
> 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

_______________________________________________

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: Guidelines on using NSJSONSerialization
      • From: Fritz Anderson <email@hidden>
References: 
 >Guidelines on using NSJSONSerialization (From: Alex Zavatone <email@hidden>)

  • Prev by Date: uiviewcontroller
  • Next by Date: RE: uiviewcontroller
  • Previous by thread: Re: Guidelines on using NSJSONSerialization
  • Next by thread: Re: Guidelines on using NSJSONSerialization
  • Index(es):
    • Date
    • Thread