消息转发的理解

NS_ASSUME_NONNULL_BEGIN

@interface NSObject (Extention)
+ (void)test;
@end

NS_ASSUME_NONNULL_END

#import "NSObject+Extention.h"

@implementation NSObject (Extention)
- (void)test{
    NSLog(@"test1");
}

@end
//增加一个方法
//+(void)test:
//-(void)test;
//能输出吗?
#import 
#import "AppDelegate.h"
#import "NSObject+Extention.h"

int main(int argc, char * argv[]) {
    NSString * appDelegateClassName;
    @autoreleasepool {
        [NSObject test];
        // Setup code that might create autoreleased objects goes here.
        appDelegateClassName = NSStringFromClass([AppDelegate class]);
    }
    return UIApplicationMain(argc, argv, nil, appDelegateClassName);
}

你可能感兴趣的:(消息转发的理解)