Touch not works

Discussion in 'iOS Programming' started by Binju, May 3, 2010.

  1. Binju macrumors member

    Joined:
    Jan 31, 2010
    #1
    Code:
    if ([touch view] == imageview)
    	{
    		NSLog(@"[touch view] == imageview");
    		
    		CGPoint location = [touch locationInView:self];
    		imageview.center = location;
    		return;
    	}
    	

    The above code is not working
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    I think you'll have to supply more information that that. What do you expect to happen? What do you observe happening? What have you tried doing to fix it?
     
  3. Binju thread starter macrumors member

    Joined:
    Jan 31, 2010
    #3
    The touch cannot dedect the imageview.



    Any one ?
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    I see no answers to the 3 questions I asked.
     
  5. Binju thread starter macrumors member

    Joined:
    Jan 31, 2010
    #5
    I am having four images and I want to move the images when the user move the imageview (touchMoved() occurs).So I need to find which image is touched by the user.


    When I move the imageview, the imageview did not dedect by the [touch view] method.



    I checked with the userinteraction enabled property and i refered the sample code "touches"
     
  6. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #6
    OK, and where is that code? A custom subclass? Are you sure you are using that class not UIImageView (especially if you created this in Interface Builder)...
     

Share This Page