Hmm, your previous message/thread made it and has two answers.

Regards,
Thomas

On May 2, 2008, at 10:41 AM, Ben wrote:

I have been reading the documentation for implementing the NSFastEnumeration protocol and am having some difficulties following it.

For completeness, here is the protocol method:
- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len;

typedef struct {
unsigned long state;
id *itemsPtr;
unsigned long *mutationsPtr;
unsigned long extra[5]; } NSFastEnumerationState;

I have a C array where the elements within it can be converted into multiple objects. Say I have 5 objects. Do I provide them all in one go and return the total number? Or just one per call and return the number remaining?

Also, should the objects be returned by reference in the stackbuf variable, or in the itemsPtr field of the state structure?

Apologies if these are basic questions, but I got decidedly lost trying to follow the docs.

Ben.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/serenity %40exscape.org

This email sent to [EMAIL PROTECTED]

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to