/ Published in: Objective C
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//interface file is SampleController.h //in SampleController.h @protocol SampleControllerDelegate; @interface SampleController : UIViewController <> { id<SampleControllerDelegate> delegate; } @property(nonatomic,assign) id<SampleControllerDelegate> delegate; @end @protocol SampleControllerDelegate <NSObject> - (void)testFunction:(SampleController*)controller; @end //in SampleController.m file @synthesize delegate // implement SampleControllerDelegate like this - (void)yourCustomFunction:(id)sender { [delegate testFunction:self]; }