[英]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 错误是说“不允许将间接指针隐式转换为目标c指针,将id隐式转换为arc
my .h file 我的.h文件
-(void) addObserver: (id <ObserverDelegate>*) observer;
@property(nonatomic, assign) NSMutableArray* queue;
Compile error on this line [self.queue addObject: observer]; 在此行编译错误[self.queue addObject:观察者];
Why are you using a pointer to an id
for the observer
parameter? 您为什么要使用指向
id
的指针作为observer
参数? Why not just have id<ObserverDelegate>
? 为什么不只有
id<ObserverDelegate>
呢?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.