- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
if ([[touch view] tag] == 1000)
{
tap=YES;
NSLog(@"tap");
//[yourButton setShowsTouchWhenHighlighted:YES];
if(tap)
{
CGRect myImageRect = CGRectMake(p.x-113, p.y-113, 224.0f, 195.0f);
myImagea = [[UIImageView alloc] initWithFrame:myImageRect];
[myImagea setImage:[UIImage imageNamed:@"Enjoy Sunburst.png"]];
myImagea.opaque = YES; // explicitly opaque for performance
[self.view addSubview:myImagea];
[myImagea release];
}
[pieMenu showInView:self.view atPoint:p];
}
else {
NSLog(@" NO tap");
// i want to remove image when user is not tapping
//how to do that is myImagea.alpha=0 is the only options
}
}
– (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { if ([[touch view] tag] == 1000) { tap=YES;
Share
I’m going to assume your touch events code is correct…
To actually remove the object, you’d do something similar to this
If you’re trying to hide it, do what Jacob stated via the
hiddenproperty