Get imagename from imageview

Discussion in 'iOS Programming' started by Binju, Apr 27, 2010.

  1. Binju macrumors member

    Joined:
    Jan 31, 2010
    #1
    I used the below code for checking the image in the imageview

    Code:
    if(imageview2.image == [UIImage imageNamed:@"9.png"])
    	{
    //Do
    
    }
    But it did not check the correct image.
     
  2. kaydell.leavitt macrumors regular

    Joined:
    Apr 19, 2010
    #2
    == or isEqualTo:

    Do you know that when you use the operator: == that the object-pointer has to be the exact same pointer.

    Maybe, you need to use the method: isEqualTo to check that the images are equivalent (though not necessarily the same exact object).

    -- Kaydell
     

Share This Page