• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Namespace clash problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Namespace clash problem


  • Subject: Namespace clash problem
  • From: Graham Cox <email@hidden>
  • Date: Fri, 14 Oct 2011 10:29:25 +1100

I just updated to Xcode 4.2 from 4.1, and I'm getting a new warning when I compile: "Multiple methods named 'style' found"

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).

(<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 may have been a bit too generic using 'style' myself, but on the other hand I have something actually called a style which is an object and so using the property 'style' is actually appropriate! </RANT>)

The question is, while this doesn't seem to cause any problems, I'm a little concerned because a) I didn't get this warning in previous versions of Xcode, b) the return types are different (NSUInteger versus an id) and c) I don't like having warnings. Changing my code to eliminate this name is going to be very, very difficult - it's used in hundreds of different places. Typecasting the return type to be the explicit object type I expect does not eliminate the warning. (I'm thinking it's safe because the return type of NSUInteger and id uses the same version of objc_message_send, but that's just lucky. If Apple's property returned a float I"d be in serious trouble.)

Is there a way to force the compiler to use the correct one?

--Graham_______________________________________________

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

  • Follow-Ups:
    • Re: Namespace clash problem
      • From: Kyle Sluder <email@hidden>
    • Re: Namespace clash problem
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Pop-up menu in NSCollectionView
  • Next by Date: Re: Pop-up menu in NSCollectionView
  • Previous by thread: Re: Pop-up menu in NSCollectionView
  • Next by thread: Re: Namespace clash problem
  • Index(es):
    • Date
    • Thread