Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Issue with null
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
iPhoneCode  
View profile  
 More options Sep 4 2009, 8:43 am
From: iPhoneCode <rodrigo.mazzi...@gmail.com>
Date: Fri, 4 Sep 2009 05:43:38 -0700 (PDT)
Local: Fri, Sep 4 2009 8:43 am
Subject: Issue with null
Hi folks,

I have realized something in Objective Support regarding the
deserialization of "null", at least JSON deserialization.
This test case {"test_class":{"created_at":null,"name":null}} results
in

TestClass.createdAt ==> nil
TestClass.name ==> "<null>"

Why does the library sets a JSON null as a NSString "<null>"?
Shouldn't it set as nil?

Rodrigo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rodrigo Mazzilli  
View profile  
 More options Sep 4 2009, 8:53 am
From: Rodrigo Mazzilli <rodrigo.mazzi...@gmail.com>
Date: Fri, 4 Sep 2009 05:53:41 -0700 (PDT)
Local: Fri, Sep 4 2009 8:53 am
Subject: Re: Issue with null
I found the problem is in NSString+Deserialize.m:

+ (NSString *) deserialize:(id)value {
        return [NSString stringWithFormat:@"%@",value];

}

If value is [NSNull null], we deserialize as (surprise!) "<null>". Is
this the expected behavior?

Rodrigo

On Sep 4, 9:43 am, iPhoneCode <rodrigo.mazzi...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Josh Vickery  
View profile  
 More options Sep 4 2009, 8:59 am
From: Josh Vickery <vicke...@gmail.com>
Date: Fri, 4 Sep 2009 08:59:25 -0400
Local: Fri, Sep 4 2009 8:59 am
Subject: Re: [ObjectiveResource] Re: Issue with null
Nice catch. If that's the problem, I think we could fix that with a
category on NSNull, NSNull+Deserialize that would have:

 + (NSString *) deserialize:(id)value {
        return nil;
 }

Care to give it a try and report back?

Josh

On Fri, Sep 4, 2009 at 8:53 AM, Rodrigo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rodrigo Mazzilli  
View profile  
 More options Sep 4 2009, 10:18 am
From: Rodrigo Mazzilli <rodrigo.mazzi...@gmail.com>
Date: Fri, 4 Sep 2009 07:18:55 -0700 (PDT)
Local: Fri, Sep 4 2009 10:18 am
Subject: Re: Issue with null
This approach doesn't work, as in NSObject+JSONSerializableSupport,
method deserializeJSON, we use the Class definition of the receiver,
i.e.
the objective_support class would need to have a NSNull * attribute,
which is obviously wrong.
The solution is very similar to the one we did in NSDate+Serialize.h.

I will fix it and push on my repository... details later.

Rodrigo

On Sep 4, 9:59 am, Josh Vickery <vicke...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rodrigo Mazzilli  
View profile  
 More options Sep 4 2009, 10:36 am
From: Rodrigo Mazzilli <rodrigo.mazzi...@gmail.com>
Date: Fri, 4 Sep 2009 07:36:29 -0700 (PDT)
Local: Fri, Sep 4 2009 10:36 am
Subject: Re: Issue with null
Fix is in on my github, master branch:
git://github.com/rodmaz/objectivesupport.git

This also includes a fix so we can use ObjectiveSupport with the
Three20 library.

Rodrigo

On Sep 4, 11:18 am, Rodrigo Mazzilli <rodrigo.mazzi...@gmail.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »