0

我正在尝试使用POST请求从服务器接收图像。我正在尝试使用 RestKit 获取图像。我已经添加了用于创建请求的请求描述符,它工作正常。但是,我不明白如何将图像与对象管理器映射,因为返回的内容不再是 JSON。

这是我得到的错误

Error Domain=org.restkit.RestKit.ErrorDomain Code=1001 "No mappable object representations were found at the key paths searched." UserInfo=0x9b7a870 {DetailedErrors=(
), NSLocalizedFailureReason=The mapping operation was unable to find any nested object     representations at the key paths searched: promotion
The representation inputted to the mapper was found to contain nested object representations at the following key paths: message, status
This likely indicates that you have misconfigured the key paths for your mappings., NSLocalizedDescription=No mappable object representations were found at the key paths searched., keyPath=null}
4

1 回答 1

0

你不应该为此使用 RestKit。RestKit 旨在用于从 JSON / XML / 映射对象......它不用于接收图像数据。相反,使用AFNetworkingRestKit 中包含的(内部用于所有通信)可以更好地处理简单的帖子和图像响应。

如果你需要做一些对象序列化来创建 JSON 来做你的帖子,那么看看使用RKSerializationand RKMapperOperation

于 2013-09-06T13:41:41.580 回答