So, your view is either the main view of a viewController, or is contained somewhere in the view hierarchy of a viewController.
I would create a delegate protocol, KalGridViewDelegate
, with a method such as:
- (void) kalGridViewWasTapped: (KalGridView *) kalGridView;
Then make UIViewController
who's view contains the KalGridView
the delegate of that view. So within, say the viewDidLoad
method of the view controller:
self.kalGridView.delegate = self;
Then within your touch method:
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
[self.delegate kalGridViewWasTapped: self];
}
and then your view controller can respond to the delegate method and push the next view controller as required.
If you don't understand delegation, you should carefully read and understand the Apple docs:
http://developer.apple.com/library/ios/#DOCUMENTATION/Cocoa/Conceptual/CocoaFundamentals/CocoaDesignPatterns/CocoaDesignPatterns.html
paying particular attention to the Protocols and Delegation sections.
Also
http://developer.apple.com/library/ios/#DOCUMENTATION/Cocoa/Conceptual/CocoaFundamentals/CommunicatingWithObjects/CommunicateWithObjects.html#//apple_ref/doc/uid/TP40002974-CH7-SW18