@protocol protoA <NSObject>
@end
@interface objA : NSObject<protoA> {
@private
}
@end
@implementation objA
@end
@protocol protoB <NSObject>
-(void) foo: (id <protoA> *) par;
@end
@interface objB : NSObject<protoB>
-(void) foo: (id <protoA> *) par;
@end
@implementation objB
-(void) foo: (id <protoA> *) par
{
//...
}
@end
in some other class method i use it this way:
objB *obj1 = [[objB alloc] init];
objA *obj2 = [[objA alloc] init];
[obj1 foo: obj2];
I have compiler error: “Implicit conversion of an Objective-C pointer to ‘__autoreleasing id*’ is disallowed with ARC
What is the proper way to do get this functionality ?
idalready is a pointer-type, use justid<Protocol>instead ofid<Protocol>*.