1 Reply
      Latest reply on Apr 12, 2019 5:01 AM by eskimo
      LFuryk Level 1 Level 1 (0 points)

        Hi!

         

        I have this problem since I updated my xcode to 10.2 version.

         

        #import "SomeProtocol.h"
        
        @interface SomeView : UIView 
        
        @property (nonatomic, nullable, copy) NSArray <id <SomeProtocol>> *items;

         

        The compiler brings me this error on line 05

        • Reference to 'SomeProtocol' is ambiguous
        • Type arguments cannot be applied to non-class type 'id'

         

        It's important to say that this error pops up on one of the libs I use when it is integrated to the main app, but it doesn't when it is compile alone.

         

        Here's the SomeProtocol:

         

        @protocol SomeProtocol 
        
        
        - (nonnull NSString *)itemId;
        - (nonnull NSString *)name;
        - (nonnull NSString *)price;
        - (nullable NSString *)discountDescription;
        - (nullable NSString *)installmentDescription;
        - (nonnull NSURL *)thumbnail;
        - (nonnull NSURL *)actionURL;
        - (BOOL)isFreeShipping;
        
        - (nonnull NSString *)type;
        
        - (nullable NSButton *)secondaryAction;
        
        @optional
        - (nullable NSString *)attributes;
        
        @end



         

        Thank you for your help!

        • Re: Reference to 'Protocol' is ambiguous - xCode 10.2
          eskimo Apple Staff Apple Staff (11,035 points)

          I tried reproducing the problem and can’t.  Presumably this is for the same reason it works when you compile the library code standalone.

          If you look at the error in the build transcript in the Report navigator, does it show you the two ambiguous versions it’s trying to choose between?

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"