tags:

views:

38

answers:

2
- (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
    }
}
+1  A: 

You can set the hidden property of the UIImageView to YES.

If you would actually want to remove it, you can call removeFromSuperview.

Jacob Relkin
A: 

I'm going to assume your touch events code is correct...

To actually remove the object, you'd do something similar to this

[someObjectHere removeFromSuperview];

If you're trying to hide it, do what Jacob stated via the hidden property

iWasRobbed
thanks you sir :-)
ram
No problem, good luck
iWasRobbed