0
这是一个非常愚蠢的问题。如何将对象传递给使用NSTimer的方法? 我的意思是这样的 -将对象传递给NSTimer中的方法
我有一个方法BigView.m
有一个方法,称为doSomethingWithClass:
。
- (void)doSomethingWithClass:(CustomClass *)class {
NSLog(@"Something was done");
}
在所谓CustomClass
另一个类,我有一个NSTimer -
NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:0.5 target:bigView selector:@selector(doSomethingWithClass:) userInfo:nil repeats:NO];
哪里bigView是BigView的一个实例。现在我想传递一个完整的CustomClass实例作为方法doSomethingWithClass:
中的参数。我该怎么做?
谢谢你,现在可以正常使用。 – aniiye 2011-04-02 17:47:36