jjzjj

articleMapping

全部标签

objective-c - Restkit - didLoadObjects 正在接收一个空数组

我已经阅读了每篇文章并浏览了教程,但我无法弄清楚为什么“对象”数组是空的。在didLoadResponse方法中,我能够在日志中看到[responsebodyAsString]。下面是我正在加载的xml和我用于对象映射的代码。任何帮助将不胜感激。Thisisatesttitleforarticle1googleLoremipsumdolorsitamet,consecteturadipiscingelit.Sedquisbibendumeros.Pellentesquehabitantmorbitristiquesenectusetnetusetmalesuadafamesacturp

ios - 如何使用 RestKit 映射 JSON 数组

我有这样格式的json字符串:[{"image":"/0001.jpg","link":"/index.php"},{"image":"/0001.jpg","link":"/index.php"}]它在顶层没有键。[mappingmapKeyPath:@"image"toAttribute:@"image"];像这样的映射是行不通的,它给我错误:restkit.object_mapping:RKObjectMapper.m:81Addingmappingerror:CouldnotfindanobjectmappingforkeyPath:''如何映射这种类型的json?