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

Re: autoreleasing NSBezierPath object


  • Subject: Re: autoreleasing NSBezierPath object
  • From: Fritz Anderson <email@hidden>
  • Date: Wed, 27 Jun 2001 11:49:37 -0500

At 8:38 PM -0700 6/26/2001, Oscar Bascara wrote:
Here's a newbie question.
In Learning Cocoa, the Dot View project calls the following line in the drawRect: method:
[[NSBezierPath bezierPathWithOvalInRect:dotRect] fill];
Does the NSBezierPath object that gets created (allocated and initialized) need to be autoreleased?
...
Or is it that the NSBezierPath object is autoreleased by default, and if you really want it, you need to retain it?

That is the case. Class methods that provide convenient allocation-and-initialization return autoreleased instances. If you write [[ClassName alloc] init...] or [instance copy...], you are responsible for the resulting object, and must release it. Otherwise it's autoreleased already.

-- F


References: 
 >autoreleasing NSBezierPath object (From: Oscar Bascara <email@hidden>)

  • Prev by Date: Re: Strange service behavior.
  • Next by Date: Re: Disclosure triangle ?
  • Previous by thread: autoreleasing NSBezierPath object
  • Next by thread: Re: autoreleasing NSBezierPath object
  • Index(es):
    • Date
    • Thread