Hello everybody,
I'm new to iphone/ipad development so please bare with me
I have multiple UIImageviews on my storyboard already assigned to images but all of them are hidden, all i want to do is show the UIImageview using its tag based on the button i press (which happens to have the same tag)
here is the code
in the .h file
here is what happens:
if i just leave it like this and run, nothing happens when i press the button
if i make a reference in the storyboard from any UIImageview to hintImage, only one reference it allowed, i cannot reference the other image views to hintImage, so accordingly in runtime when i click the button only the referenced imageview appears no matter which button i choose
can anybody tell me how to fix it and i if i have a wrong logic!!
I'm new to iphone/ipad development so please bare with me
I have multiple UIImageviews on my storyboard already assigned to images but all of them are hidden, all i want to do is show the UIImageview using its tag based on the button i press (which happens to have the same tag)
here is the code
in the .h file
Code:
IBOutlet UIImageView *hintImage;
@property (nonatomic, retain) IBOutlet UIImageView *hintImage;
in the implementation file
@synthesize hintImage;
-(IBAction)appear:(id)sender{
int imageIndex = ((UIButton *)sender).tag;
[hintImage viewWithTag:imageIndex];
hintImage.hidden = NO;
}
if i just leave it like this and run, nothing happens when i press the button
if i make a reference in the storyboard from any UIImageview to hintImage, only one reference it allowed, i cannot reference the other image views to hintImage, so accordingly in runtime when i click the button only the referenced imageview appears no matter which button i choose
can anybody tell me how to fix it and i if i have a wrong logic!!
Last edited by a moderator: