In my app I have a UIScrollView and within that I have programmatically created UIImageViews. This is based off the Tab-bar template in Xcode. What I'm trying to do is to change Tabs when a particular image is pressed, and whilst I'm able to register the event as a touch, changing the tabIndex does nothing. Typing in the following code:
UITabBarController *tab=self.tabBarController;
if (tab){
NSLog(@"Good");
}
else {
NSLog(@"No Good");
Always results in No Good being Logged. The code I've written can be seen here, where my UIScrollView is of type ScrollViewer: @implementation scrollViewer - (void) touchesEnded: (NSSet *) touches withEvent: (UIEvent *) event {
if (!self.dragging) {
NSLog(@"Recieved Touch!");
UITouch *aTouch = [touches anyObject];
MainView *theInstance = [[MainView alloc] init];
CGPoint point = [aTouch locationInView:self];
theInstance.ycoord = point.y;
[theInstance touchHand];
}
[super touchesEnded: touches withEvent: event];
}
@end
Any help is appreciated thanks!