How can I make it so the image goes away when it is touched.
Here is my code to create the image. It is randomly displayed on screen so after you touch it, it disappears and a new image in a new place appears.
-(void)drawStarsAndDetectTouches{ //uses random numbers to display a star on screen
//create random position
int xCoordinate = arc4random() % 267;
int yCoordinate = arc4random() % 420;
//make sure it doesnt draw onto titiles
if (yCoordinate <= 40) {
yCoordinate = arc4random() % 420;
}
UIImageView *starImgView = [[UIImageView alloc] initWithFrame:CGRectMake(xCoordinate, yCoordinate, 58, 40)]; //create ImageView
starImgView.image = [UIImage imageNamed:@"star.png"];
[self.view addSubview: starImgView];
[starImgView release];
}