The header documentation for NSPointerArray says:

Fast enumeration, copying, and archiving protocols are applicable only when NSPointerArray is configured for Object uses. Since the array may contain NULLs, fast enumeration (for..in) will yield NULLs. As a convenience, fast enumeration will also enumerate other types of pointers. Copying and coding are undefined for non-object uses.

That seems self contradictory with respect to fast enumeration. It is only applicable when NSPointerArray is configured for Objects, but as a convenience, it will enumerate non-object types anyway even though it is inappropriate to do so?

Can anyone offer clarification?

When I try to be honest about the enumeration, i.e.

        for (void *pointer in pointerArray) {
        
        }

the compiler complains with

pointer-array.m:20: error: selector element does not have a valid object type

- Jim

_______________________________________________

Cocoa-dev mailing list ([email protected])

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