简体   繁体   中英

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];

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM