this will be difficult without pasting my whole code, but I am hoping I’m missing something simple. Basically, when there is a web link (coming from an NSDictionary), I would like to show a UIbutton, when there isn’t, the button should be invisible.
First of all I set the UIButton to invisible in - (void)viewDidLoad
thereafter is a method - (void)animationDidEndOnAnswer where the button should appear if there is a link. If I just put button.alpha = 1; then it displays at the correct time, but what I’m trying to do is have it not display if there is no weblink.
Here is the code I currently have in that method:
- (void)animationDidEndOnAnswer
{
if ([[questions questionOnScreen] objectForKey:@"link"] == @"") {
leesmeerButton.alpha = 0;
}
else {
leesmeerButton.alpha = 1;
}
NSLog(@"link is %@", [[questions questionOnScreen] objectForKey:@"link"]);
}
In the log, when there is no link I see nothing (not even a space). When there is, I see the proper weblink… I’ve also tried if ([[questions questionOnScreen] objectForKey:@"link"] == nil) but that also didn’t work.
Any help is appreciated! thanks!!
The problem lies on this line
instead of that use