Reputation: 1162
I would like to return an object of the protocol in the method. Any quicker way to achieve this? Thanks.
#import "OverlayView.h"
@protocol ErrorOverlayDelegate <NSObject>
- (void)errorOverlayOKButtonAction:(UIButton*)sender;
@end
@interface ErrorOverlay : UIView
@property (nonatomic, weak) id<ErrorOverlayDelegate> delegate;
@end
Upvotes: 0
Views: 329
Reputation: 450
Just add one more parameter to your method, preferably the first argument, like the example below:
- (void)errorOverlay:(ErrorOverlay *)overlay OKButtonAction:(UIButton *)sender;
Then pass self
as the argument.
Upvotes: 2