Sunday, 15 May 2011

mongodb - Xcode: model adding entities -



mongodb - Xcode: model adding entities -

i experimenting api returns fields underscore _id. not able map field in -xcdatamodel. attribute must begin letter.

i've tried map field "id" , provide in "user info" session key/value id : _id without success.

do have solution problem? know there many apis have fields underscore.

other non underscore fields mapped without problems.

{ "__v": 0, "_avratedelay": 5, "_avraterecommend": 5, "_avratestaff": 5, "_id": "530f733df222bf594b190e0a10", "_reviews": 1, "active": 1, "address": { "city": "little rock", "country": "usa", "other": "", "state": "az", "street": "2701 e roosevelt rd", "zip": "72206" }, "location": { "lat": 34.721175, "lng": -92.24168600000002 }, "name": "certainteed 69" }

don't utilize id or _id in objective-c. id reserved word. since many servers utilize recommend write mapping code mapped server id identifier.

since need write code parse fields anyway there no hardship key , alter it. can store mapping in nsentitydescription , set code other mappings , alter them. way can alter other server styled values created_at objective-c counterparts createdat.

the key/values editable straight in model editor , accessible via -entity property on nsmanagedobject.

mongodb core-data ios7 xcode5 mmrecord

No comments:

Post a Comment