Skip navigation.
 
mlRe: Trying to understand -- please help...
FROM : Sherm Pendley
DATE : Thu May 22 23:59:42 2008

On Thu, May 22, 2008 at 5:13 PM, Johnny Lundy <<email_removed>> 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

Related mailsAuthorDate
mlTrying to understand -- please help... john darnell May 21, 18:05
mlRe: Trying to understand -- please help... Torsten Curdt May 21, 18:13
mlRe: Trying to understand -- please help... Vijay Malhan May 21, 18:16
mlRe: Trying to understand -- please help... Paul Bailey May 21, 18:20
mlRe: Trying to understand -- please help... Hank Heijink (Mail… May 21, 18:28
mlRe: Trying to understand -- please help... João Pavão May 21, 18:29
mlRe: Trying to understand -- please help... Gérard Iglesias May 21, 18:34
mlRE: Trying to understand -- please help... john darnell May 21, 18:41
mlTrying to understand -- please help... Peter Hudson May 21, 18:47
mlRe: Trying to understand -- please help... Gérard Iglesias May 21, 18:49
mlRe: Trying to understand -- please help... Clark Cox May 21, 19:03
mlRe: Trying to understand -- please help... Gérard Iglesias May 21, 19:11
mlRe: Trying to understand -- please help... Shawn Erickson May 21, 19:17
mlRe: Trying to understand -- please help... Bill Bumgarner May 21, 19:21
mlRe: Trying to understand -- please help... Hank Heijink (Mail… May 21, 19:25
mlRe: Trying to understand -- please help... Shawn Erickson May 21, 19:32
mlRe: Trying to understand -- please help... Sherm Pendley May 21, 19:36
mlRe: Trying to understand -- please help... Shawn Erickson May 21, 19:38
mlRe: Trying to understand -- please help... Ilan Volow May 21, 19:40
mlRe: Trying to understand -- please help... I. Savant May 21, 20:05
mlRe: Trying to understand -- please help... I. Savant May 21, 20:07
mlTrying to understand -- please help... Johnny Lundy May 21, 20:35
mlRe: Trying to understand -- please help... Shawn Erickson May 21, 20:45
mlRe: Trying to understand -- please help... Vijay Malhan May 21, 20:47
mlRe: Trying to understand -- please help... Bill Bumgarner May 21, 20:48
mlRe: Trying to understand -- please help... Shawn Erickson May 21, 20:54
mlRe: Trying to understand -- please help... I. Savant May 21, 20:57
mlRe: Trying to understand -- please help... Shawn Erickson May 21, 21:00
mlRe: Trying to understand -- please help... I. Savant May 21, 21:00
ml+initialize (was Re: Trying to understand -- please help...) Jason Stephenson May 21, 21:00
mlRe: Trying to understand -- please help... Michael Vannorsdel May 21, 21:07
mlRe: Trying to understand -- please help... Ilan Volow May 21, 21:08
mlRe: Trying to understand -- please help... Vijay Malhan May 21, 21:14
mlRe: Trying to understand -- please help... Shawn Erickson May 21, 21:24
mlTrying to understand -- please help... Johnny Lundy May 21, 21:37
mlRe: Trying to understand -- please help... Andy Lee May 21, 21:41
mlRe: Trying to understand -- please help... Jeff LaMarche May 21, 21:58
mlRe: Trying to understand -- please help... Sherm Pendley May 21, 22:07
mlRe: Trying to understand -- please help... Sherm Pendley May 21, 22:20
mlRe: Trying to understand -- please help... Uli Kusterer May 21, 22:33
mlRe: Trying to understand -- please help... Sherm Pendley May 21, 22:37
mlRe: Trying to understand -- please help... Uli Kusterer May 21, 22:45
mlRe: Trying to understand -- please help... Sherm Pendley May 21, 22:52
mlRe: Trying to understand -- please help... Christopher Nebel May 21, 23:06
mlRe: Trying to understand -- please help... Hamish Allan May 21, 23:09
mlRe: Trying to understand -- please help... Sherm Pendley May 21, 23:15
mlRe: Trying to understand -- please help... Ken Thomases May 21, 23:28
mlRe: Trying to understand -- please help... Sherm Pendley May 21, 23:29
mlRe: Trying to understand -- please help... Andy Lee May 22, 01:18
mlRe: Trying to understand -- please help... Jens Alfke May 22, 04:23
mlRe: Trying to understand -- please help... Jens Alfke May 22, 04:30
mlRe: Trying to understand -- please help... Jens Alfke May 22, 04:37
mlRe: Trying to understand -- please help... Michael Vannorsdel May 22, 04:55
mlRE: Trying to understand -- please help... Caleb Strockbine May 22, 16:27
mlRe: Trying to understand -- please help... Greg Titus May 22, 17:43
mlRe: Trying to understand -- please help... glenn andreas May 22, 18:25
mlRe: Trying to understand -- please help... Andy Lee May 22, 22:08
mlRe: Trying to understand -- please help... Andy Lee May 22, 22:15
mlRe: Trying to understand -- please help... Joseph Kelly May 22, 22:16
mlRe: Trying to understand -- please help... Johnny Lundy May 22, 23:13
mlRe: Trying to understand -- please help... glenn andreas May 22, 23:42
mlRe: Trying to understand -- please help... Sherm Pendley May 22, 23:59
mlRe: Trying to understand -- please help... Andy Lee May 23, 00:02