cool hit counter Can Objective-C static methods be overridden?_Intefrankly

Can Objective-C static methods be overridden?


First look at a piece of code

#import <Foundation/Foundation.h>

@interface Person : NSObject

+ (void)pringName:(NSString *)name;

@end
#import "Person.h"

@interface Person()

@end

@implementation Person

+ (void)pringName:(NSString *)name
{
    NSLog(@"Person-%@",name);
}

@end
#import <Foundation/Foundation.h>
#import "Person.h"

@interface Student : Person

@end
#import "Student.h"

@implementation Student

+ (void)pringName:(NSString *)name
{
    NSLog(@"Student-%@",name);
}

@end
- (void)viewDidLoad {

    [Student pringName:@"Simon"];
}
2018-03-13 09:18:06.371043+0800 DD[50663:8176634] Student-Simon

You can see from the above print message that static methods can be overridden


Recommended>>
1、Smooth even with 1G memory Googles new Android system for lowend phones is here
2、Git
3、What is the principle of the accelerated package to grab Spring Festival tickets Does it really work Read it and youll see
4、India joins hands with blockchain to improve banking efficiency
5、The source of the power of the Manwë film

    已推荐到看一看 和朋友分享想法
    最多200字,当前共 发送

    已发送

    朋友将在看一看看到

    确定
    分享你的想法...
    取消

    分享想法到看一看

    确定
    最多200字,当前共

    发送中

    网络异常,请稍后重试

    微信扫一扫
    关注该公众号