Reputation: 3
@interface SomeClass
- (void)funcA;
+ (void)funcB;
@end
@interface Test
@property(nonatomic, assign) Class aClass;
@end
@implementation Test
- (void) test {
// that's ok
[[aClass new] funcA];
// but how to call class method?
[aClass funcB] ?
}
@end
XCode note "Instance method 'function' is being used on 'Class' which is not in the root class"
Upvotes: 0
Views: 61
Reputation: 5543
[((id)aClass) funcB];
or similarly to @Pancho's answer
[[aClass class] funcB];
Upvotes: 1
Reputation: 4143
Have you tried ?
[[aClass class] performSelector:@selector(funcB)];
Upvotes: 3