I know others asked similar questions but I checked and their problems isn't the same as mine.
Here is the code from the customImageView
@implementation KeysTest
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self.userInteractionEnabled:YES];
self.image = [UIImage imageNamed:@"whitekey.gif"];
}
return self;
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
NSLog(@"test!");
}
For some reason, it doesn't recognize the userInteractionEnabled method. Also, the codeSense feature didn't work for the touchesBegan method.
I'm not sure that your code sample would compile correctly. But commenter Sam is correct, [self.userInteractionEnabled:YES]
is not a proper function. This needs to be changed to
self.userInteractionEnabled = YES;