そのため、これら 2 つの機能の違いは何か、または少なくともそれらをマージする方法について少し混乱しています。私はこの記述子を持っているこの状況を持っています:
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 はある場所では nil であり、他の場所ではありません。
これはうまくいきます...しかし、それは無駄に多くのコピーペーストです。そのためにRKRouterを使用できますか?
どうもありがとう!