Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @protocol Delegate
- @required
- - (void) onCall;
- @end
- @interface CallCore : NSObject{
- id delegate;
- }
- + (id)initWithDelegate:(id)obj;
- - (void) callOnCall;
- @property id delegate;
- @end
- @interface Call : NSObject<Delegate>{
- CallCore *caller;
- }
- @property CallCore *caller;
- @end
- @implementation CallCore
- @synthesize delegate = _delegate;
- + (id)initWithDelegate:(id)obj
- {
- CallCore *retn = [[CallCore alloc] init];
- [retn setDelegate:obj];
- return retn;
- }
- - (void) callOnCall
- {
- if([[self delegate] conformsToProtocol:@protocol(Delegate)])
- [[self delegate] onCall];
- }
- @end
- @implementation Call
- @synthesize caller = _caller;
- - (id) init{
- caller = [CallCore initWithDelegate:self];
- [caller callOnCall];
- return self;
- }
- - (void) onCall{
- printf("Call::onCall");
- }
- @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement