I have a weird behavior with NSURLConnection (still trying to have my
custom protocol to handle some HTTP GET behind the scene). So as Maciej
suggested I am investigating the used for NSURLConnection.
And the implementation for the class TSCustomConnection is something
- initURLConnectionWithRequest:(NSURLRequest *)request
_request = [request retain];
_data = nil;
I don't know if this is causing your problems, but this init method is
not correct. In any init method where you call super, you should write
code like this:
if((self = [super init])) // can be initWithWhatever...
There are variations on this theme, but the important part is that you
always assign self to the return value of [super init] and you always
check it. It's completely possible that [super init] will release self
and return another object instead, or simply return nil to indicate
failure of some sort.
99% of the time, init returns the same thing you called it on, and so
this could very well not be causing any trouble, but it's still good
practice to follow for that other 1%.
"Hello," he lied.
-- Don Carpenter quoting a Hollywood agent