• 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 17:10:45 +0100

On 15 Sep 2015, at 16:45, Jens Alfke <email@hidden> wrote:


On Sep 15, 2015, at 8:36 AM, Dave <email@hidden> wrote:

Class<LTWDetailViewProtocol>

That declaration doesn’t make sense, because the class Class (i.e. a metaclass) can’t conform to a protocol. I think that’s the source of the strange warning; the compiler is sort of confused about whether that type denotes a class or an instance.

Change the type to just plain Class and it should compile.

If I remove it from the method definition, then I won’t get a warning if I pass a class to it that doesn’t conform. 

The thing is adding the “conformsToProtocol" statement was just belt-and-braces because the code will crash and burn if the Class and resultant Instance do not conform and the warning generated on the call was ignored.

I’m not sure which is best/worst?!?

Cheers
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

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

  • Prev by Date: Re: Strange XCode Warning
  • 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