RestKit GET请求queryParameter:没有匹配responseDescriptor
我试图用Restkit做一个请求,但我得到以下错误:
{Error Domain=org.restkit.RestKit.ErrorDomain Code=1001 "No mappable object representations were found at the key paths searched." UserInfo={NSLocalizedDescription=No mappable object representations were found at the key paths searched., NSLocalizedFailureReason=The mapping operation was unable to find any nested object representations at the key paths searched: This likely indicates that you have misconfigured the key paths for your mappings., keyPath=null, DetailedErrors=( )}}, keyPath=null, NSLocalizedDescription=No response descriptors match the response loaded.}
Request-URL是: http : //www.iwi.hs-karlsruhe.de/hskampus-news/api/kampus-api.php?getCategoriesNiceJSON
ResponseDescriptor看起来像:
let newsCategoryResponseDescriptor = RKResponseDescriptor(mapping: NewsCategory.restKitObjectMapping(), method: RKRequestMethod.GET, pathPattern: Constants.Backend.NewsCategoryResource, keyPath: nil, statusCodes: RKStatusCodeIndexSetForClass(RKStatusCodeClass.Successful))
PathPattern:
hskampus-news/api/kampus-api.php?getCategoriesNiceJSON
我怎样才能configuration我的ResponseDescripter来匹配我的请求与URL参数?