• 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: Nevermind
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Nevermind


  • Subject: Re: Nevermind
  • From: "John C. Randolph" <email@hidden>
  • Date: Mon, 5 Nov 2001 13:32:46 -0800

On Monday, November 5, 2001, at 12:55 PM, Dan Huntsinger wrote:

I just realized that my last message about NSImage initialization was pretty
dumb. I think I found my problem. The "title" string that I'm releasing
was never actually allocated, and so doesn't need releasing, hence the
access error and crash. I guess was treating the "pathForImageResource"
method like a convenience constructor for the string, when it is not.
Please correct me if I'm wrong.

To be precise: it *was* allocated, but it was also autoreleased by the NSBundle method that created it. The rule is, if *you* alloc, retain or copy something, then you have to release it.

-jcr

"This is not a book to be tossed aside lightly. Rather, it should be hurled with great force." -Dorothy Parker


References: 
 >Nevermind (From: Dan Huntsinger <email@hidden>)

  • Prev by Date: Re: cocoa newbie questions
  • Next by Date: Re: deserializeBytes question
  • Previous by thread: Nevermind
  • Next by thread: Re: deserializeBytes question
  • Index(es):
    • Date
    • Thread