Hi everyone,
I've used delegate many times, but i've just realized something that i dont know why it can be like that.
Let say a class A has a delegate which implements a protocol B.
- Class A :
@interface A : NSObject {
id<B> delegate;
}
@end
- Protocol B :
@protocol B
- object : (A *) a doSomething : (SomeClass *) s
@end
Because A references B, B references A, I dont know how can i define both things. I know it's possible (the UITableView and UITableViewDelegate is an example), but i dont know how. I've tried to go arround this problem but the compiler keeps giving me errors.
Thanks for reading my post.
I've used delegate many times, but i've just realized something that i dont know why it can be like that.
Let say a class A has a delegate which implements a protocol B.
- Class A :
@interface A : NSObject {
id<B> delegate;
}
@end
- Protocol B :
@protocol B
- object : (A *) a doSomething : (SomeClass *) s
@end
Because A references B, B references A, I dont know how can i define both things. I know it's possible (the UITableView and UITableViewDelegate is an example), but i dont know how. I've tried to go arround this problem but the compiler keeps giving me errors.
Thanks for reading my post.