On Wed, Oct 1, 2008 at 3:34 PM, Christopher J Kemsley <[EMAIL PROTECTED]>wrote:

> I'm writing a program that, in one table view, has the following code:
>
>  id receivedName = [theDatabase itemAtIndex:editedRow] ;
>> editedRowName = [receivedName mutableCopy] ;
>> [receivedName release];
>>
>
> where "editedRowName" is defined as an NSMutableString.

...

> Does anybody know where this leak is coming from?


You're not following the standard memory-management rules. You created an
object with a method with "copy" in its name, therefore you're obligated to
release that object.

    <
http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Tasks/MemoryManagementRules.html
>

(Before anybody yells at me saying that the iPhone SDK cannot be discussed
> here, read this: http://developer.apple.com/iphone/program/  )


This discussion is kosher because it's equally applicable to Cocoa on Mac OS
X, and would have been kosher regardless of whether the NDA was still in
effect or not.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to