Hello everyone I'm trying to work with a custom delegate in my cell ...
In my file.h the custom cell I entered this:
#import <UIKit/UIKit.h>
#import <Parse/Parse.h>
@class FFCustomCellWithImage;
@protocol FFCustomCellWithImageDelegate
- (void) customCell:(FFCustomCellWithImage *)cell button1Pressed:(UIButton *)btn;
@end
@interface FFCustomCellWithImage : UITableViewCell
@property (nonatomic, assign) id<FFCustomCellWithImageDelegate> delegate;
@property (strong, nonatomic) IBOutlet PFImageView *FotoPost;
@property (strong, nonatomic) IBOutlet PFImageView *FotoProfilo;
@property (strong, nonatomic) IBOutlet UILabel *NomeUtente;
@property (strong, nonatomic) IBOutlet UILabel *TestoPost;
@property (strong, nonatomic) IBOutlet UILabel *DataPost;
@property (strong, nonatomic) IBOutlet UIView *backgroundCell;
@property (strong, nonatomic) IBOutlet UIButton *LeggiCommentoButton;
@property (strong, nonatomic) IBOutlet UIButton *AddGoPoint;
@property (strong, nonatomic) IBOutlet UILabel *CountGoPoint;
@end
and in my file.m the custom cell I entered this
#import "FFCustomCellWithImage.h"
#import <Parse/Parse.h>
@implementation FFCustomCellWithImage
@synthesize delegate;
-(void)buttonPressed{
if (delegate && [delegate respondsToSelector:@selector(customCell:button1Pressed:)]) {
[delegate customCell:self button1Pressed:self.AddGoPoint];
}
}
the problem is that it gives me an error saying that respondsToSelector Know no instance method
Where is my mistake? sorry but I'm new to the delegates and am trying to learn