Re: NSURLConnection retaining delegate?
Re: NSURLConnection retaining delegate?
- Subject: Re: NSURLConnection retaining delegate?
- From: Alexander Spohr <email@hidden>
- Date: Wed, 25 Nov 2009 21:53:59 +0100
Shame on me!
I meant NSURLConnection.
Andy, sorry that I bothered you with the wrong test.
This is one example where copy-paste is better than fresh typing...
So the (corrected) question still stands:
is NSURLConnection retaining its delegate?
atze
Am 25.11.2009 um 21:19 schrieb Andy Lee:
> On Wednesday, November 25, 2009, at 12:15PM, "Alexander Spohr" <email@hidden> wrote:
>> is NSConnection retaining its delegate?
>> (At least as long as it is collecting data)
>
> FWIW I've never used NSConnection, but in the following quick and dirty code it did not retain the delegate I gave it.
>
> TestDelegate * aTestDelegate = [[[TestDelegate alloc] init] autorelease];
> NSConnection * aConn = [[NSConnection alloc] initWithReceivePort:nil sendPort:nil];
> [aConn setDelegate:aTestDelegate];
>
> The TestDelegate object got dealloced despite being the NSConnection's delegate.
>
>>
>> I thought contract is that a delegate is never retained?
>
> I think there is at least one class that breaks the rule about not retaining delegates (and is documented accordingly). I forget which it is and I don't have time to search for it, but it doesn't seem to be NSConnection.
>
> --Andy
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden