• 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: Question regarding getRectsBeingDrawn:'s constant array pointer argument (const NSRect **)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question regarding getRectsBeingDrawn:'s constant array pointer argument (const NSRect **)


  • Subject: Re: Question regarding getRectsBeingDrawn:'s constant array pointer argument (const NSRect **)
  • From: "Shawn Erickson" <email@hidden>
  • Date: Tue, 9 May 2006 17:52:26 -0700

On 5/9/06, Eric <email@hidden> wrote:
The method signature is this:

- (void)getRectsBeingDrawn:(const NSRect **)rects count:(int *)count

Which according to the documentation, should be invoked as:

const NSRect *rects;
int count, i;
[self getRectsBeingDrawn:&rects count:&count];

This implies that getRectsBeingDraw will allocate an array of NSRect and
assign it to rects.

My question is, since I didn't allocate the array of NSRect, should I
deallocate the rects array after use, or will Cocoa take care of that for
me?

The array of rects is only valid while in drawRect:. You didn't allocate them so you don't do any memory management for them.

-Shawn
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Question regarding getRectsBeingDrawn:'s constant array pointer argument (const NSRect **) (From: Eric <email@hidden>)

  • Prev by Date: Re: Does there exist a Cocoa compatibility test tool?
  • Next by Date: NSConditionLock vs. plain variable question...
  • Previous by thread: Question regarding getRectsBeingDrawn:'s constant array pointer argument (const NSRect **)
  • Next by thread: NSOpenPanel causing hang on subsequent NSTask
  • Index(es):
    • Date
    • Thread