Peter Warbo
Peter Warbo

Reputation: 11728

Xcode incompatible pointer types subclass

I'm getting this warning in Xcode when I try to send an object which is a subclass of the expected class.

[reminder addContactsObject:individual]; addContactsObject method is expecting that the input should be of type Contact. The individual that I'm sending is a subclass of Contact (Individual : Contact).

So why is this generating a warning?

Edit: Added code...

Reminder.h

@interface Reminder : NSManagedObject

- (void)addContactsObject:(Contact *)value;

Contact.h

@interface Contact : NSManagedObject

Individual.h

@interface Individual : Contact

Upvotes: 11

Views: 1811

Answers (1)

Paul de Lange
Paul de Lange

Reputation: 10633

Probably need to include the Individual header. If you don't the compiler won't know the superclass

Upvotes: 21

Related Questions