• 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: memory problem, advice needed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: memory problem, advice needed


  • Subject: Re: memory problem, advice needed
  • From: Jonathon Mah <email@hidden>
  • Date: Sat, 1 Apr 2006 17:02:18 +1030

Hi Paul,

 NSArray *myBigArray = [NSArray arrayWithObjects: mySmallArray1,
mySmallArray2 ,nil];

How do I ensure that when myFun() ends, myBigArray is released?

Assuming you don't need to use myBigArray after myFun() returns, the easiest way is to _not_ use autoreleasing convenience constructors.


i.e.
NSArray *myBigArray = [[NSArray alloc] initWithObjects:...];
//...
[myBigArray release];



Jonathon Mah
email@hidden


_______________________________________________ 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: 
 >Re: memory problem, advice needed (From: Paul Gribble <email@hidden>)

  • Prev by Date: vImage crop?
  • Next by Date: Re: memory problem, advice needed
  • Previous by thread: Re: memory problem, advice needed
  • Next by thread: Re: memory problem, advice needed
  • Index(es):
    • Date
    • Thread