I placed the object in middle of the screen and move the object from left to right.(10 objects). If touched the objects and i make as invisible (setHidden) but still object will moving and collided at end of object . What method will use for object make invisible and stop the object at the same position.
I used the following method 1.setHidden 2. removeFromSuperview
But still is not working. Plz help
Sample code:
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
for(int i = 0; i < no_images; i++)
{
img_arrows = [arr_Container objectAtIndex:i];
UITouch *touch = [[event allTouches]anyObject];
if([touch view]== img_arrows)
{
tag2 = [img_arrows tag];
// printf("tag in touch method----->>>>%d\n",tag2);
switch(tag2)
{
case 0:
if(y_axis[i] >=190 && y_axis[i] <=214)
{
if(x_start_arrows > x_end)
{
[img_good setHidden:NO];
[img_arrows setHidden:YES];
}
}
}
}
}