Re: NSXMLParser frees itself on error?
Re: NSXMLParser frees itself on error?
- Subject: Re: NSXMLParser frees itself on error?
- From: Jeff Johnson <email@hidden>
- Date: Thu, 7 May 2009 10:37:31 -0500
On May 7, 2009, at 2:38 AM, Marcel Weiher wrote:
EXACTLY. Autorelease allows ownership transfer from called
methods to occur without thrusting ownership on those that don't
want it.
That's one use, anyway.
No. That is what you need autorelease for. Anything else is fluff.
No, autorelease can be used to ensure that the returned object is
valid within the scope of the caller, where it otherwise may have been
deallocated. The caller may only be interested in analyzing the object
to see its property or to compare it to some other object without
taking ownership of it.
The delegate never has ownership of the object.
Usually the delegate is the owner. That is, the owner allocates the
object and sets itself as the delegate.
That's your opinion. Doesn't matter though: it is in the role of
the owner that the object gets to release the object, not in the
role of the delegate.
That's correct, which is why wrapping autorelease pools around your
delegate callbacks is a bad idea. :-)
And NSXMLParser is not a good example to generalize upon, because
as we see with your code fragment, you don't even need delegate
methods to know when it's done.
PRECISELY.
I'm still waiting to hear a solution for the fully async cases.
What "fully async" case? Message-sending in Objective-C is
synchronous.
Now you're just being obtuse, because I already mentioned
NSURLConnection, for example. Is the connection finished loading when -
[NSURLConnection initWithRequest:delegate:] returns? Unless there was
an immediate error, no.
_______________________________________________
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