Re: ARC and NSFastEnumeration
Re: ARC and NSFastEnumeration
- Subject: Re: ARC and NSFastEnumeration
- From: Greg Parker <email@hidden>
- Date: Mon, 19 Sep 2011 12:46:49 -0700
On Sep 19, 2011, at 3:33 AM, 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.
>
> Does anyone have any examples of ARC and NSFastEnumeration they can refer me to?
Try declaring it like this (as seen in protocol NSFastEnumeration from NSEnumerator.h)
- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id __unsafe_unretained []) stackbuf count:(NSUInteger)len;
That should tell ARC what to do with the contents of stackbuf.
--
Greg Parker email@hidden Runtime Wrangler
_______________________________________________
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