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

About NSEnumerator


  • Subject: About NSEnumerator
  • From: "Jay" <email@hidden>
  • Date: Wed, 18 Apr 2007 12:02:00 +0800

NSArray *anArray = // ... ;

NSEnumerator *enumerator = [anArray objectEnumerator];

id object;



while ((object = [enumerator nextObject])) {

    // do something with object...

}

Above is the example given in the reference from Apple website.
The question is that, should the declared vairable "object" be released after this loop has ended, or just leave it alone? If so, should it be released inside each loop, at the ending?
Thanks.

regards,
Jay
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: About NSEnumerator
      • From: "I. Savant" <email@hidden>
  • Prev by Date: Re: PNG in the pasteboard
  • Next by Date: Re: About NSEnumerator
  • Previous by thread: CoreData, NSPredicate, searching for object with a specific number objects of relationships
  • Next by thread: Re: About NSEnumerator
  • Index(es):
    • Date
    • Thread