About NSEnumerator
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