Reference to 'Protocol' is ambiguous - xCode 10.2

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!

Replies

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"

Hi, i have the same issue. It doesn't say the two ambiguous versions in the build transcript. When i press jump to definition on the jumps to the wrong file though...


a fix would be highly appreciated!

My recommendation is that you open a DTS tech support incident so DTS’s tools specialist can take an in-depth look at your project.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"