Hey guys! I have this little problem:
I have one ViewController which adds 2 subViews in my ViewController so I have something like this:
//in my viewController.m i have this:
- (void)startIcons
{
IconHolder *newIconHolder = [[IconHolder alloc] initWithItem:@"SomeItenName"];
[self.view addSubview:newIconHolder];
}
- (void)onPressIcon targetIcon(IconHolder *)pressedIcon
{
NSLog(@"IconPressed %@", [pressedIcon getName]);
}
And this is my subclass touchs:
//And in my IconHolder.m i have this:
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
//Here i need to call the method onPressIcon from my ViewController
}
Now: How can I do that? The best way is create a linkage in my constructor to save my ViewController? How am I supposed to do that?
Thanks!