Re: NSString's "mutableCopy" creating a leak?
Re: NSString's "mutableCopy" creating a leak?
- Subject: Re: NSString's "mutableCopy" creating a leak?
- From: Christopher J Kemsley <email@hidden>
- Date: Wed, 1 Oct 2008 13:16:51 -0700
A bit more information about what's going on:
The object is a subclass of UIViewController. When I click on
something in a UITableView, it allocates this object and initializes
it to use as an editor.
Example: You're looking at a list of stuff, and you click on one of
the object to bring up an editor pane. The list you're looking at
allocates the object, which then sets the editedRowName.
On initialization, I set editedRowName to the mutableCopy.
Later, when I pop the view controller, the navigtionController
deallocates the object (and I have verified this). In the
deallocation, it used to call [editedRowName dealloc].
Only once is editedRowName set to anything - in the initialization
stage. Later, the only modification is [editedRowName setString:....],
but this does not cause a memory leak.
I was not aware that I shouldn't explicitly call a dealloc... Why not?
Replacing it with a "release" in the object made that leak go away,
but I still don't understand why I can't dealloc it.
I. Savant, thank you for your comments on the NDA - they were exactly
right.
I believe you all have answered my main question though, and that is
that I should use only release/retain statements - not dealloc
statements.
_______________________________________________
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