I\'m currently trying to use a UIButton titled \"X\" as a way to remove a Sprite from the view.
Basically, my code works so that when a Sprite is touched, a message is s
You should do this in the Sprite
class, so in the original class:
-(void)spriteSelected:(Sprite *)sprite{
[sprite youAreSelected];
}
In the Sprite
class:
-(void)youAreSelected {
[self.button addTarget:self action:@selector(removeMe:) forControlEvents: UIControlEventTouchDown];
}
-(void)removeMe:(id)sender {
[self removeFromSuperView];
}