#import <Foundation/Foundation.h>
#import "Person.h"
@interface Person : NSObject
-(void)test;
@end
@implementation Person
-(void)test{
NSLog(@"test!");
}
int main(int argc, const char * argv[]) {
@autoreleasepool {
Person *p = [Person new];
// [p test];
//手动的把test方法包装成 SEL 类型
SEL s1 = @selector(test);
//响应方法
[p performSelector:s1];
}
return 0;
}
|