Re: ARC and NSFastEnumeration
Re: ARC and NSFastEnumeration
- Subject: Re: ARC and NSFastEnumeration
- From: Graham Cox <email@hidden>
- Date: Mon, 19 Sep 2011 20:39:22 +1000
If it has an NSArray, you don't have to follow that tutorial - NSArray already implements NSFastEnumeration, so your wrapper can simply call the same methods on NSArray. Job done.
The tutorial is somewhat artificial in that it creates an object using a C array (and secondly a linked list) as its internal storage, which of course have no methods at all.
--Graham
On 19/09/2011, at 8:33 PM, Devraj Mukherjee wrote:
> I am trying to implement fast enumeration for a wrapper object that
> has an NSArray, following this tutorial
> http://cocoawithlove.com/2008/05/implementing-countbyenumeratingwithstat.html
>
> Obviously ARC doesn't like the way
>
> - (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState
> *)state objects:(id *)stackbuf count:(NSUInteger)len
>
> is implemented.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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