Sample code below. Basically, in the code below, Game creates a bunch of objects called of type DragView. From within these DragView objects when touchesBegin is fired, I need it to call back to a method adjustScore within Game to adjust the score.
@interface Game : UIViewController
{
}
@end
@Implementation Game
DragView *dragger;
- (void)loadView
{
dragger = [[DragView alloc] initWithFrame:dragRect];
//simplified...code actually makes lots of these
}
+ (void) adjustScore
{
NSLog(@"This is called from within DragView");
//does some more stuff…
}
@end
@interface DragView : UIImageView
{
CGPoint startLocation;
}
@end
@implementation DragView
- (void) touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event
{
NSLog(@"Touched");
///// help needed here to call "adjustScore" in Game above /////
}