Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 790
Peter Warbo Avatar asked Mar 25 '13 14:03

Peter Warbo


1 Answers

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

like image 177
Paul de Lange Avatar answered Nov 09 '22 02:11

Paul de Lange