In C4, the way to do this is to use the following method:
-(void)performSelector:withObject:afterDelay:
And for the current version of C4, the best way to use this is:
#import "C4WorkSpace.h"
@interface C4WorkSpace ()
-(void)methodToRunImmediately;
@end
@implementation C4WorkSpace {
C4Shape *circle;
}
-(void)setup {
circle = [C4Shape ellipse:CGRectMake(100, 100, 100, 100)];
[self.canvas addShape:circle];
[self performSelector:@selector(methodToRunImmediately) withObject:nil afterDelay:0.1];
}
-(void)methodToRunImmediately {
circle.animationDuration = 1.0f;
circle.animationOptions = AUTOREVERSE | REPEAT;
circle.center = CGPointMake(384, 512);
}
@end
This code will start your animations after the 1 / 10th second of the delay ... which will look immediately.
, , , . :
-(void)runMethod:afterDelay:
, C4 :
[self performSelector:@selector(methodToRunImmediately)
withObject:nil
afterDelay:0.1];
... :
[self runMethod:@"methodToRunImmediately" afterDelay:0.1];