RKResponseDescriptor *responsePlant = [RKResponseDescriptor responseDescriptorWithMapPing:plantMapPing pathPattern:@"/API/rest/plants/:plant_ID" keyPath:nil statusCodes:RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful)];
现在,我想做这样的事情
RKResponseDescriptor *responsePlantAll = [RKResponseDescriptor responseDescriptorWithMapPing:plantMapPing pathPattern:@"/API/rest/plants/" keyPath:@"objects" statusCodes:RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful)];
请注意,keyPath在一个地方是零,而在另一个地方则不是.
这有效…但它是很多副本粘贴.我可以使用RKRouter吗?
非常感谢!
解决方法 你调用两个不同的路径,所以使用两个不同的RKResponseDescriptor对我来说非常有意义!I also would like to kNow if you can or should use RKRouter with
RKResponseDescriptor?
我真的建议使用Routes.有了它们,我的所有路径都集中在我的RKObjectManager子类中,所以如果我必须改变路径,我不必到处寻找!
总结以上是内存溢出为你收集整理的ios – RKResponseDescriptor vs RKRouter全部内容,希望文章能够帮你解决ios – RKResponseDescriptor vs RKRouter所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)