Re: Trying to understand -- please help...
Re: Trying to understand -- please help...
- Subject: Re: Trying to understand -- please help...
- From: "Sherm Pendley" <email@hidden>
- Date: Thu, 22 May 2008 17:59:42 -0400
On Thu, May 22, 2008 at 5:13 PM, Johnny Lundy <email@hidden> wrote:
> My point in using that class reference was simply to show how someone could
> follow the "manual" and still have his code not work.
And everyone else's point is that someone who goes straight to the class
reference is skipping the first half of the manual, and then (quite often)
complaining that the material they skipped isn't repeated in the second
half. That's like skipping the first semester of a foreign language class,
then demanding the teacher repeat everything in the second, so you can catch
up. It's not an effective way to learn the material, and it's an unfair and
unnecessary distraction to the students who *were* paying attention the
first time.
> Actually, the "introductory documentation" never actually says that the
> convenience constructors always return autoreleased objects -- it just says
> that they "in general" do (paraphrasing).
There's a reason the list guidelines suggest linking to the memory
management rules instead of paraphrasing them. Quite often, even experienced
developers get the summary wrong to some degree - which, I'm sorry to say,
you have done in this summary. The *correct* rules can be found here:
<
http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Tasks/MemoryManagementRules.html
>
> The way it is written, the objects are retained; so one should conclude
> that they are not autoreleased.
On what basis would someone who *hasn't* skipped the introductory material
above make that conclusion? And, given that skipping that material leads, as
you've shown here, to false conclusions, on what do you base your assertion
that skipping the introduction is a good idea?
The method you referred to above (+arrayWithObjects) is not one of those
listed in the memory management docs as requiring you to release the
returned object, and it's not explicitly documented as being an exception to
the general rule. The only reasonable conclusion that someone who' *has*
read the intro docs could arrive at is that the general rule applies -
releasing the returned object is not your responsibility.
> If that is true, there is nothing wrong with the documentation.
What you're saying is not true, and the documentation correctly says it's
not true.
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
_______________________________________________
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