Re: program termination after releasing self defined NSXMLParser class
Re: program termination after releasing self defined NSXMLParser class
- Subject: Re: program termination after releasing self defined NSXMLParser class
- From: Roland King <email@hidden>
- Date: Sat, 17 Apr 2010 01:07:53 +0800
Nice try Kyle but that bug is still outstanding with apple as open and I maintain that the UITextField doesn't respond to the method it's sending its delegate and the hang in that case, if we're talking about the same case, is due to a different interaction. It may be that having self as delegate is an issue in some classes, but in UITextField it's not because the object sends itself a message which is also part of its delegate protocol.
It remains true that some classes don't like being their own delegates (or having subclasses of themselves as their delegate) and if you have that situation and start seeing a crash, splitting the class and delegate is a reasonable thing to try.
On 17-Apr-2010, at 12:44 AM, Kyle Sluder wrote:
> On Fri, Apr 16, 2010 at 9:25 AM, Jens Alfke <email@hidden> wrote:
>> That’s true in general, but in this case he’s setting the parser’s delegate
>> to itself. Which is weird, but should mean that the object can’t possibly
>> outlive the delegate :)
>
> Well there's yer problem! :D
>
> The first step is not making an object its own delegate. We've seen
> plenty of cases (including one recently with UITextField) where
> objects send themselves messages that are also part of their delegate
> protocol. So this is never a good idea to begin with.
>
> --Kyle Sluder
> _______________________________________________
>
> 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
_______________________________________________
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