Search code examples
iphoneios5weak-referencesmgtwitterengine

Incompatible pointer types assigning to NSObject<MGTwitterEngineDelegate> *__weak from NSObject


"Incompatible pointer types assigning to NSObject *__weak from NSObject"

When using MGTwitterEngine I get this error. If I turn off "treat warnings as errors" it seems to skip over. Why is this happening?

__weak NSObject <MGTwitterEngineDelegate> *_delegate;

When I tried removing the __weak I got more errors.


Solution

  • - (id)initWithXML:(NSData *)theXML delegate:(NSObject *)theDelegate connectionIdentifier:(NSString *)theIdentifier requestType:(MGTwitterRequestType)reqType responseType:(MGTwitterResponseType)respType URL:(NSURL *)theURL

    becomes

    - (id)initWithXML:(NSData *)theXML delegate:(NSObject <MGTwitterParserDelegate>*)theDelegate connectionIdentifier:(NSString *)theIdentifier requestType:(MGTwitterRequestType)reqType responseType:(MGTwitterResponseType)respType URL:(NSURL *)theURL {

    And replace similar instances of NSObject delegates, usually in init methods, throughout the MGTwitterEngine.