Cannot hide a UIButton - Please help!

Posted by Neurofluxation on Stack Overflow See other posts from Stack Overflow or by Neurofluxation
Published on 2010-03-19T12:08:59Z Indexed on 2010/03/19 15:01 UTC
Read the original article Hit count: 366

Hey again,

I have the following code:

visitSite.hidden = YES;

For some reason, when I click a UIButton and call this piece of code, the visitSite button does not hide.

The code is within this block:

-(IBAction)welcomeButtonPressed:(id)sender {
  [UIButton beginAnimations:@"welcomeAnimation" context:NULL];
  [UIButton setAnimationDuration:1.5];
  [UIButton SetAnimationDidStopSelector:@selector(nowHideThisSiteButton:finished:context:)];
  [UIButton setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:YES];
  ((UIView *)sender).hidden = YES;
  [UIButton commitAnimations];
}

and the stop selector below:

-(void)nowHideThisSiteButton:(NSString *)animationID finished:(BOOL *)finished context:(void *)context {
  visitSite.hidden = YES;
}

I've also tried [visitSite setHidden:YES]; and that fails as well. ALSO I've noticed that the setAnimationDidStopSelector does not get called at all.

Also, visitSite (when NSLogged) equals:

<UIButton: 0x1290f0; frame = (0 0; 320 460); opaque = NO; autoresize = RM+BM; layer = <CALayer: 0x1290f0>>

visitSite.hidden (when NSLogged) equals: NULL

Any more ideas? :(

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c