iPhone object-c 的reflection使用方法
摘要:
// Without reflection Foo *foo = [[Foo alloc] init]; [foo hello]; // With reflection Class cls = NSClassFromString(@"Foo"); id foo = [[cls alloc] init]; SEL selector = NSSelectorFromString(@"hello"); [foo performSelector:selector withObject:nil]; 阅读全文