• 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
Re: Strange XCode Warning
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange XCode Warning


  • Subject: Re: Strange XCode Warning
  • From: Dave <email@hidden>
  • Date: Tue, 15 Sep 2015 18:48:24 +0100


On 15 Sep 2015, at 18:23, Jens Alfke <email@hidden> wrote:


On Sep 15, 2015, at 9:19 AM, Dave <email@hidden> wrote:

Class<ProtocolX> was allowable and would cause the compiler to generate a warning if “MyClass” does not conform to “ProtocolX”, e.g.

I’ve never seen that used before … which doesn’t prove it isn’t real, but I’m suspicious. Have you tested whether it actually triggers such a warning?

I just tried it now with XCode 6.4 and you’re right, it doesn’t generate a warning.

I’m 90% sure I’ve used this in the past and it worked.

If this isn’t part of Objective-C then I can’t think why not? Seems like a good thing to have and no reason why it couldn’t/shouldn’t work that I can think of?

This fixes it:

if ([(Class)theDetailViewClass conformsToProtocol:@protocol(LTWDetailViewProtocol)] == NO)

Yeah, that would imply that the compiler sees “Class<ProtocolX>” as an instance type, not a class.

I’m surprised it doesn’t give an error or a warning for this, the fact it didn’t led me to believe that it was valid Objective-C.

Thanks a lot
Dave


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Strange XCode Warning (From: Dave <email@hidden>)
 >Re: Strange XCode Warning (From: Jens Alfke <email@hidden>)
 >Re: Strange XCode Warning (From: Dave <email@hidden>)
 >Re: Strange XCode Warning (From: Dave <email@hidden>)
 >Re: Strange XCode Warning (From: Dave <email@hidden>)
 >Re: Strange XCode Warning (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: How to specify source dirs with lldb?
  • Next by Date: Re: Strange XCode Warning
  • Previous by thread: Re: Strange XCode Warning
  • Next by thread: Re: Strange XCode Warning
  • Index(es):
    • Date
    • Thread