Reputation: 353
I'm trying to do some RESTKit http requests, and when I use the RKResponseDescriptor line of code, it says 'responseDescriptorWithMapping:pathPattern:keyPath:statusCodes:' is deprecated.
Here is how I coded it:
RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor
responseDescriptorWithMapping:mapping pathPattern:nil keyPath:nil
statusCodes:statusCodeSet];
What exactly is the deal here, and how can I fix it?
Upvotes: 10
Views: 3335
Reputation: 880
I had to search a fair bit to figure out what to put for method, so I thought I would share the specifics for others:
RKResponseDescriptor *responseDescriptor =
[RKResponseDescriptor responseDescriptorWithMapping:mapping
method:RKRequestMethodAny
pathPattern:nil keyPath:nil
statusCodes:statusCodeSet];
I used the general RKRequestMethodAny, but you can use something more specific if you prefer.
Upvotes: 6
Reputation: 32404
Restkit 0.20.3 introduced new feature that allows you to use a response descriptor with multiple requests methods
+ (instancetype)responseDescriptorWithMapping:(RKMapping *)mapping
method:(RKRequestMethod)method
pathPattern:(NSString *)pathPattern
keyPath:(NSString *)keyPath
statusCodes:(NSIndexSet *)statusCodes
So you can just switch to this new implementation.
Upvotes: 13