oc的静态函数static

oc的静态函数与类函数不同;

 

1、静态函数与c++中表现一致,只在模块内部可见;

2、静态函数内部没有self变量;

3、静态函数不参与动态派发;没有在函数列表里;是静态绑定的;

 

@implementation PXGooooogo

 

+ (BOOL) testEgo{

    NSLog(@"eeeeee");

    return true;

}

 

static BOOL whatAction()

{

    //NSLog(@"%@", self);

    NSLog(@"gggggg");

    return true;

};

 

@end

posted @ 2019-02-14 17:28  zzfx  阅读(1342)  评论(0编辑  收藏  举报