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?
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With