我怎样才能使用[self performSelector: withObject: afterDelay:]
方法+(void)classMethod
?
我在下面定义了一个精灵:
+(void)classMethod
{
CCSprite * sprite = [CCSprite spriteWithFile:@"sprite.png"];
//and hope afterDelay3.0second remove this sprite
[self performSelector:@select(clean:) withObject:sprite afterDelay:3.0];
}
+(void)clean:(CCSprite *)sprite
{
[sprite removeFromSuperView];
}