Hello everyone, (sorry for my english first)
I'll explain you my problem.
I have a UIViewController (TagCloudNavigationController) with a lot of UIViewController (MyTag) instance inside. Each instance is like an icon with an UIImageView and a UILabel. My desire is to push a new UIViewController when a user touch one of these icons.
I have a method called switchViews which works perfect if I call them from a button placed in my parent view (TagCloudNavigationController).
But when I call this method from the touchesBegan :
it doesn't work !! the switchiews method is called (i see the nslog inside) but nothing happened.
I think the mistake comes from the calling of the switchViews.
Anyone can help me please.
Thanks
I'll explain you my problem.
I have a UIViewController (TagCloudNavigationController) with a lot of UIViewController (MyTag) instance inside. Each instance is like an icon with an UIImageView and a UILabel. My desire is to push a new UIViewController when a user touch one of these icons.
I have a method called switchViews which works perfect if I call them from a button placed in my parent view (TagCloudNavigationController).
Code:
- (IBAction)switchViews:(id)sender {
// Navigation logic may go here. Create and push another view controller.
NavigationViewController *newViewController = [[NavigationViewController alloc] init];
newViewController.tagTitle = @"Surf";
[self.navigationController pushViewController:newViewController animated:YES];
}
But when I call this method from the touchesBegan :
Code:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch* touch = [touches anyObject];
if (touch.phase == UITouchPhaseBegan)
{
TagCloudNavigationController *huh = [[TagCloudNavigationController alloc] init];
[huh switchViews:self.view.window];
}
}
it doesn't work !! the switchiews method is called (i see the nslog inside) but nothing happened.
I think the mistake comes from the calling of the switchViews.
Anyone can help me please.
Thanks