views:

92

answers:

2

Hello,

I want to write an "if" statement of an uiimageview to see which image is in the image currently. So if the uiimageview has this certain image, lets say "hello.png", then do this action. If it has "bye.png" then do this action.

Thanks,

Kevin

A: 

UIImageView objects don't keep a name as part of the object. You need to keep track of what file is in what image view either by subclassing and adding a name attribute or some other means.

progrmr
+1  A: 

I would do that by a BOOL field in your Model instead of checking the UIImageView.

You can update the boolean flag at the same time you update your imageview.

MVC - Model View Controller.

Do not relly on view-related items for business logic. You might change to a "MovieViewController" (I know it doesn't exist!) in the future and having the separation of concerns is the best.

Flavio