Reputation: 96541
I was looking at the NSURLConnection
class today, specifically researching method:
- (void) connection: (NSURLConnection *) conn didFailWithError:(NSError *)error {
Turns out it is deprecated. Documentation seems to offer no hints as to the replacement of this method. How should i proceed finding it please?
Upvotes: 2
Views: 513
Reputation: 299643
In most cases, deprecation notices include the replacement method. See Deprecated UITableViewDelegate Methods and Deprecated NSFileManager Methods for an examples. In this case, the documentation is a little confusing, and you should let the doc writers know that. At the bottom of the web page there's a place to provide feedback.
As other responders have noted, there's little actual change here, since they just moved the old informal protocol into a formal protocol. But the docs are misleading and they should fix it.
Here's a copy of the feedback I've sent:
This page gives the impression that you shouldn't use these methods anymore. In fact, you should, but they've been moved to a formal protocol. This should be stated more clearly in the deprecation notice.
Upvotes: 3
Reputation: 86691
The reason is that in IOS5 that informal protocol has been formalised as NSURLConnectionDelegate and the documentation sucks.
Upvotes: 1
Reputation: 4438
Check the documentation for NSURLConnectionDelegate
Protocol. It looks like that method you're looking for is in there.
Upvotes: 0
Reputation: 28242
connection:didFailWithError:
is still available; it's just been moved to an official protocol (NSURLConnectionDelegate
). You just need to make sure your class declares that it implements the protocol:
@interface YourClass : NSObject <NSURLConnectionDelegate> { ... }
Upvotes: 2