I just installed xcode 5 and I'm now receiving this warning. I've never seen it before. My app runs fine, but I hate seeing a warning. Does anyone know what this is and how to fix it? Thanks
Property type 'id' is incompatible with type 'id' inherited from 'UIToolbar'
It is hard to tell from the lack of context, but this appears to be a duplicate of Syntax for resolving incompatible property type on inherited delegate
The problem is likely that you are creating a new property with the same name but with different protocols attached.
For example, UIToolBar
has the following property:
@property(nonatomic, assign) id<UIToolbarDelegate> delegate;
If you were to declare the below in your class, it would generate this warning because the two properties have different protocols:
@property(nonatomic, assign) id<MyBetterDelegate> delegate;
There are two ways to solve this. You could modify your protocol to inherit from the other protocol:
@protocol MyBetterDelegate<UIToolbarDelegate>
...
Or you could modify your property definition to capture both protocols:
@property(nonatomic, assign) id<MyBetterDelegate, UIToolbarDelegate> delegate;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With