Hello,
I am having some issues using UIGestureTapRecognizer with an UIView.
Here is part of the code.
When I click on my UIView on get the "Unrecognized selector sent to instance" exception.
As far as I can tell, I'm not doing anything incorrectly. If anyone sees something that is incorrect with this code please share because I can't find it.
is also defined in the .h file, if that makes any difference.
thanks!
I am having some issues using UIGestureTapRecognizer with an UIView.
Here is part of the code.
Code:
-(void)goToControlsView:(id)sender{
NSLog(@"The album view has been tapped!");
}
-(void)applicationDidFinishLaunching:(UIApplication *)application{
window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].applicationFrame];
window.backgroundColor = [UIColor whiteColor];
window.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
albumView = [[UIView alloc]initWithFrame:[[UIScreen mainScreen]bounds]];
albumView.backgroundColor = [UIColor blueColor];
[window addSubview:albumView];
controlView = [[UIView alloc]initWithFrame:[[UIScreen mainScreen]bounds]];
controlView.backgroundColor = [UIColor redColor];
[window addSubview:controlView];
controlView.hidden = YES;
tapGestureRecognizer = [[UITapGestureRecognizer alloc]initWithTarget:albumView action:@selector(goToControlsView:)];
tapGestureRecognizer.numberOfTapsRequired = 1;
[albumView addGestureRecognizer:tapGestureRecognizer];
//any iOS code can go here
//Do some iOS stuff method
[window makeKeyAndVisible];
}
When I click on my UIView on get the "Unrecognized selector sent to instance" exception.
As far as I can tell, I'm not doing anything incorrectly. If anyone sees something that is incorrect with this code please share because I can't find it.
Code:
goToControlsView:(id)sender
thanks!
Last edited: