Hi.
Are there any other way of displaying an object/button/whatever for for example 3 seconds than with a NSTimer?
Thank you :)
EDIT:
Could I use an animation to do this? I'll try.
Hi.
Are there any other way of displaying an object/button/whatever for for example 3 seconds than with a NSTimer?
Thank you :)
EDIT:
Could I use an animation to do this? I'll try.
You could try:
[UIVIew beginAnimations:nil context:nil];
[UIView setAnimationDelay:3];
[UIView setAnimationDuration:0.1]; //or lower than 0.1
button.hidden = YES;
[UIView commitAnimations];
Marco
You may use -performSelector:withObject:afterDelay:
, though it uses a timer internally.
[theLabel performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:3];
You cannot use -setHidden:
with this method because 1
is not an object, but you can use NSInvocation
.
NSInvocation* invoc = [NSInvocation invocationWithMethodSignature:[theLabel methodSignatureForSelector:@selector(setHidden:)]];
[invoc setTarget:theLabel];
[invoc setSelector:@selector(setHidden:)];
BOOL yes = YES;
[invoc setArgument:&yes atIndex:2];
[invoc performSelector:@selector(invoke) withObject:nil afterDelay:3];