• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSString's "mutableCopy" creating a leak?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSString's "mutableCopy" creating a leak?
      • From: Andy Lee <email@hidden>
    • Re: NSString's "mutableCopy" creating a leak?
      • From: j o a r <email@hidden>
    • Re: NSString's "mutableCopy" creating a leak?
      • From: Charles Steinman <email@hidden>
    • Re: NSString's "mutableCopy" creating a leak?
      • From: "I. Savant" <email@hidden>
  • Prev by Date: Print report using WebView
  • Next by Date: Re: NSString's "mutableCopy" creating a leak?
  • Previous by thread: Re: NSString's "mutableCopy" creating a leak?
  • Next by thread: Re: NSString's "mutableCopy" creating a leak?
  • Index(es):
    • Date
    • Thread