Re: [Q] Weird problem with the NSTableView
Re: [Q] Weird problem with the NSTableView
- Subject: Re: [Q] Weird problem with the NSTableView
- From: JongAm Park <email@hidden>
- Date: Wed, 06 Dec 2006 20:39:35 -0800
Um.. For the 1), well.. it was typo. I'm sorry. When I wrote email, I
didn't comment it out. I'm sorry.
2).. Well, this was the reason. However it was created with the
convenience method, arrayWithObject, not initWithObject. So, the it
should be handled automatically. it is also said in the document.
-- Creating Objects Using Convenience Methods --
Many classes provide methods of the form +className... that you can use
to obtain a new instance of the class. Often referred to as “convenience
constructors”, these methods create a new instance of the class,
initialize it, and return it for you to use. Although you might think
you are responsible for releasing objects created in this manner, that
is not the case according to the policy Cocoa set—the method name does
not contain "alloc" or "copy", or begin with "new". Because the class
creates the new object, it is responsible for disposing of the new object. A
----------------------------------------------------------------------------------------
However, when I append 'retain" to to arrayWithObjects, the problem is
gone. It is strange to me.
Do I misunderstand something?
Thanks.
Shawn Erickson wrote:
1) You appear to set the value of encodingStringArray_CF twice in the
above code.
2) You don't retain the array you assign to encodingStringArray_CF.
(review Cocoa memory management [1])
-Shawn
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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