1
我'上的不同對象執行cancelPreviousPerformRequestsWithTarget:選擇:對象:所有對象
[self performSelector:@selector(doSmth) withObject:objectA afterDelay:1];
[self performSelector:@selector(doSmth) withObject:objectB afterDelay:1];
[self performSelector:@selector(doSmthElse) withObject:objectA afterDelay:1];
調度不同的選擇,我想取消所有「doSmth」,那怎麼辦?不知道對象傳遞
這將取消一切
[NSObject cancelPreviousPerformRequestsWithTarget:self];
,這將取消任何操作(如對象不匹配)
[NSObject cancelPreviousPerformRequestsWithTarget:object
selector:@selector(doSmth) object:nil];
即使我想除了行爲是(取消任何對象,當零通過,但這不會發生)