I have create a delegate in our custom UIView, here is the code:
@protocol CustomViewDelegate
@optional
- (void) CustomViewDidInitialize:(CustomView *)customView;
@end
@interface CustomView : UIView {
@private
}@property(nonatomic, assign) id<CustomViewDelegate> delegate;
@end
The above code is not working because the CustomView interface has not been declared at the time of the CustomViewDelegate declaration.
So, now I tried it by adding a prototype ala C++ before the @protocol like this:
@interface FunView;
But it's also not solving my problem, so anyone have the solution then please tell me, thank you.
Tarun Kumar
17-Dec-2015To forward declared protocols do like this: