On Oct 13, 2011, at 4:29 PM, Graham Cox wrote:
> When I go into this warning, it further states it's using
> [NSProgressIndicator style] instead of my own declared method style which
> exists in many different objects (and which would be correct).
This only happens when calling -style on an untyped (id) pointer. Cast the
pointer to your class and you won’t have a problem. Instead of
[[array lastObject] style]
use
[(MyClass*)[array lastObject] style]
This has the added advantage that, if you ever renamed or removed your -style
method, the compiler would be able to warn you if you didn’t fix this call.
> (<RANT> why do Apple have to steal such obvious names when they know there is
> a namespace problem? This could easily have been named
> 'progressIndicatorStyle' and have much less chance of clashing with user code.
I would rather have shorter, clearer names in framework classes. The
name-collision thing doesn’t happen to me often, and when it does I just use a
typecast like above.
—Jens_______________________________________________
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]