【发布时间】:2011-10-29 01:50:30
【问题描述】:
如何将一种方法作为参数传递给另一种方法?我正在跨班级这样做。
A类:
+ (void)theBigFunction:(?)func{
// run the func here
}
B类:
- (void)littleBFunction {
NSLog(@"classB little function");
}
// somewhere else in the class
[ClassA theBigFunction:littleBFunction]
C类:
- (void)littleCFunction {
NSLog(@"classC little function");
}
// somewhere else in the class
[ClassA theBigFunction:littleCFunction]
【问题讨论】:
-
你传递了选择器,这是一个类似的问题:stackoverflow.com/questions/519600/…
标签: iphone objective-c ios xcode selector