ios - Can't Resolve Type in Protocol -
#import "mpocontactauthorizationmanager.h" @protocol mpocontactauthorizationmanagerdelegate <nsobject> - (void)authorizationmanger:(mpocontactauthorizationmanager *)manager didupdatecontactstate:(contactsstate)contactstate; @end
mpocontactauthorizationmanager
, contactstate
not resolving types though declared in mpocontactauthorizationmanager:
#import "mpocontactauthorizationmanagerdelegate.h" typedef enum _contactsstate { kcontactsstateunknown, kcontactsstateallowed, kcontactsstatedisallowed } contactsstate; @interface mpocontactauthorizationmanager : nsobject <uialertviewdelegate> { contactsstate _contactsauthorizationstate;; } @property (strong, nonatomic) nsobject<mpocontactauthorizationmanagerdelegate> *delegate; @property (nonatomic) contactsstate contactsauthorizationstate;
any ideas why these not resolving? both getting error "expected type"
thanks mike
you have circular dependency. update mpocontactauthorizationmanagerdelegate.h
header getting rid of #import
line , adding following:
@class mpocontactauthorizationmanager;
just before @protocol
line.
just put both in 1 .h file (you still need forward declaration mpocontactauthorizationmanager
):
typedef enum _contactsstate { kcontactsstateunknown, kcontactsstateallowed, kcontactsstatedisallowed } contactsstate; @class mpocontactauthorizationmanager; @protocol mpocontactauthorizationmanagerdelegate <nsobject> - (void)authorizationmanger:(mpocontactauthorizationmanager *)manager didupdatecontactstate:(contactsstate)contactstate; @end @interface mpocontactauthorizationmanager : nsobject <uialertviewdelegate> { contactsstate _contactsauthorizationstate;; } @property (strong, nonatomic) nsobject<mpocontactauthorizationmanagerdelegate> *delegate; @property (nonatomic) contactsstate contactsauthorizationstate;
Comments
Post a Comment