JSON parsing in iOS with RestKit fails

balderman

New Member
I am building an iOS app, and I am using RestKit v0.20 for mapping a JSON file.The JSON file structure is the next:\[code\]{ "artists":{ "@total":"100", "@page":"1", "@itemsPerPage":"30", "artist":[ { "@sortName":"Ai Phoenix", "@name":"Ai Phoenix", "@mbid":"ffb0ac71-a438-4fce-91a5-58041aba0135", "url":"http:\/\/www.setlist.fm\/setlists\/ai-phoenix-13d78159.html" }, { "@sortName":"Phoenix", "@name":"Phoenix", "@mbid":"02f4c1ff-65e0-4412-8e8b-6239b0faecb5", "url":"http:\/\/www.setlist.fm\/setlists\/phoenix-53d653f9.html" } ]}\[/code\]I don't know how to map these attributes that have the prefix "@" (@sortname, @name, @mbid). I have tried to map as a normal field (@"@name", @"@mbid", ...) and it fails. In the other hand, @"url" is working well for the "url" field. I have searched and all I have got is that this notation is because of a translation from a XML file, called Badgerfish.I this could help, have got the correspondant XML to this JSON file:\[code\]<artists total="100" page="1" itemsPerPage="30"> <artist sortName="Ai Phoenix" name="Ai Phoenix" mbid="ffb0ac71-a438-4fce-91a5- 58041aba0135"> <url> http://www.setlist.fm/setlists/ai-phoenix-13d78159.html </url></artist>\[/code\]If anybody can help me, I would appreciate it. Thanks everybody!
 
Top