Use of extern in Objective C

后端 未结 5 1676
无人及你
无人及你 2020-12-07 11:30

How good is it to use extern in Objective C? It does make coding for some parts easy.. but doesn\'t it spoil the object orientation?

5条回答
  •  天涯浪人
    2020-12-07 11:51

    There are some use cases for the extern keyword in Objective-C.
    Aaron Hillegass suggests to create global notification names extern. e.g.:

    extern NSString* const XYYourNotification;
    

    You then define the actual NSString* in your implementation

提交回复
热议问题