简体   繁体   English

禁止使用arc将ios的间接指针隐式转换为目标c的id指针

[英]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.

相关问题 使用ARC隐式转换指向objective-c指针的间接指针 - implicit conversion of an indirect pointer to an objective-c pointer with ARC ARC 不允许将 Objective-C 指针隐式转换为“void *” - implicit conversion of an Objective-C pointer to 'void *' is disallowed with ARC ARC 不允许目标 c 类型指针“CFDataRef”的隐式转换? - implicit conversion of objective c type pointer 'CFDataRef' is disallowed with ARC? ARC不允许将Objective-C指针隐式转换为'const char *'? - Implicit conversion of an Objective-C pointer to 'const char *' is disallowed with ARC? 从Objective-C指针到int *的隐式转换不允许使用ARC - Implicit Conversion from Objective-C Pointer to int * is Disallowed With ARC ARC不允许对Objective-C指针进行隐式转换 - Implicit conversion of an Objective-C pointer is disallowed with ARC ARC不允许将非Objective-C指针类型&#39;void *&#39;隐式转换为&#39;__unsafe_unretained id *&#39; - Implicit conversion of a non-Objective-C pointer type 'void *' to '__unsafe_unretained id *' is disallowed with ARC 使用ARC不允许使用指向'CFReadStreamRef *'的Objective-C指针的间接指针 - Cast of an indirect pointer to an Objective-C pointer to 'CFReadStreamRef *' is disallowed with ARC TPMultiLayoutViewController的ARC转换; ARC不允许将Objective-C指针隐式转换为“ const void *” - ARC conversion of TPMultiLayoutViewController; Implicit conversion of an Objective-C pointer to 'const void *' is disallowed with ARC 错误:在NSTimer选择器中,ARC无法将Objective-C指针隐式转换为&#39;SEL _Nonnull&#39; - Error : Implicit conversion of an Objective-C pointer to 'SEL _Nonnull' is disallowed with ARC in Selector Of NSTimer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM