user1118019
user1118019

Reputation: 3959

ios implicit conversion of an indirect pointer to an objective c pointer to id is disallowed with arc

hi the following block of code is giving me error

-(void) addObserver: (id <ObserverDelegate>*) observer {    
     [self.queue addObject: observer]; //ERROR ON THIS LINE
}

error is saying 'implicit conversion of an indirect pointer to an objective c pointer to id is disallowed with arc

my .h file

-(void) addObserver: (id <ObserverDelegate>*) observer;
@property(nonatomic, assign) NSMutableArray* queue;

Compile error on this line [self.queue addObject: observer];

Upvotes: 2

Views: 1184

Answers (1)

Shaggy Frog
Shaggy Frog

Reputation: 27601

Why are you using a pointer to an id for the observer parameter? Why not just have id<ObserverDelegate>?

Upvotes: 4

Related Questions