convertToRemoteExpectedType Returning null in iOS4

15 views
Skip to first unread message

Jensen

unread,
Jul 27, 2010, 2:56:31 AM7/27/10
to ObjectiveResource
Greetings!

I was using ObjectiveResource just fine with the previous iPhone SDK
(3.x).

Now, when I try to run the same App in the iOS4 SDK Simulator, it
seems the convertToRemoteExpectedType function is returning null when
attempting to POST JSON to my server (the resources are nested)

This is from the debugging console:

2010-07-26 20:49:53.000 FoodTips[1617:207] Error
Domain=org.brautaset.JSON.ErrorDomain Code=1 "Unsupported value for
key foodtip in object" UserInfo=0x5d71e10
{NSLocalizedDescription=Unsupported value for key foodtip in object}
2010-07-26 20:49:53.001 FoodTips[1617:207]
convertToRemoteExpectedType: (null)
2010-07-26 20:49:53.003 FoodTips[1617:207] Error
Domain=org.brautaset.JSON.ErrorDomain Code=1 "Unsupported value for
key foodtip in object" UserInfo=0x5a84170
{NSLocalizedDescription=Unsupported value for key foodtip in object}

If I run the same code in the 3.2 iPhone Simulator, it works just
fine.

Here's the code I'm using to POST:

NSString *tipPath = [NSString stringWithFormat:@"%@%@/%@/%@%@",
[self getRemoteSite],
@"foodtips",
@"1",
[self getRemoteCollectionName],
[self getRemoteProtocolExtension]];

Response *res = [Connection post:[theTip convertToRemoteExpectedType]
to:tipPath];

Any ideas? Thanks a bunch!

Jensen

unread,
Jul 28, 2010, 6:20:53 AM7/28/10
to ObjectiveResource
Just to update - it's definitely a problem when serializing the
object.

If I manually create the JSON string, instead of relying on the
"convertToRemoteExpectedType" function, all works just fine.

Again, this works as planned in the 3.x simulator. Is there anything
with regards to serialization in iOS4 that anybody has noticed with
ObjectiveResource? Settings? Thanks!

Dranes Ragiac

unread,
Aug 9, 2010, 10:09:46 PM8/9/10
to ObjectiveResource
Just for the record i had the same issue and i fix it changing the
line 46 in NSObject+PropertySupport.m "currentClass = [currentClass
superclass]" by this one "currentClass = nil;" seems like superclass
properties are breaking json serialization. i'm using iphone sdk 4.0
Reply all
Reply to author
Forward
0 new messages