Friday 15 February 2013

RestKit using nested JSON -


I'm having difficulty using RestKit to access data.

I access "Jobs" data in this JSON file.

Re: {accountResult: 1, account: [userStore: {idString: "de454657", idName: "alpha"}, deptId: 245, jobs: [Color: "Black" , "Black"}, shoes: {color: {job: "584349965", "black"}}, ["job": "584349964", pahhash: 566889, uniform: {color: "blue", tie: "red"} Pahash: 566867, Uniform: {Color: "blue", tie: "red"}, shoes: {color: "black", les: "black"}}, {job id: "584349978", pHash 566879, uniform: {Color: "blue", tie: "red"}, shoes: {color: "black", les: "black"}}]}]}}

Can "Account" level and "IDNAM" and "D For items such as Tiaidi "map, but I can not determine access to" jobs "data.

  keyPath: @ "Feedback Accounts.jobs"  

Does not work successfully How does it do it?

Thanks for any help or suggestions.

UPDATE - Data for accessing the solution but there is no solution to the basic question, which is asked if there is any way to directly access work data.

I have a solution but still someone is looking for someone to work with.

Since "Jobs" is a JSON array within the "Account" array, so I can parse mapping by two mappings - in the first account and then in jobs.

  RK objectmapping * accountMapping = [RK Object Mapping Mapping Four Class: [Account Class]]; [AccountMapping addAttributeMappingsFromDictionary: @ {@ "deptId": @ "DPT"}]; RK Object Mapping * Jobbapping = [RK Object Mapping Mapping Forex: [Job Class]]; [Jobbapping additimetmapping: @ {@ "JobID": @ "JobID"}]; [Account Mapping Adoptmapping: [RKR response mapping relation mapping from path: @ "Job" to capeth: @ "Job" Mapping: Jobbapping]];  

Is there any way to map jobs directly without reading into account? I just need to list all the jobs in the file - there is no account information or it is necessary for my project in relation to them. I can clearly read both data points and then use only those job statistics I can do what I want - I hoped that there is a way to avoid dragging both in (account and jobs) and only jobs Kari is the way out?

No, you can not do your solution with several mapping is the correct approach, if you have the 'Container' object Is not required, then after mapping is complete you can skip it, but you can not directly index it in the array, so that you can not drill to that level.


No comments:

Post a Comment