我经常使用 #pragma mark - Description
在 Xcode 中组织我的方法。但是,我发现有时我需要为我的方法设置类别和子类别,如下所示:
Public Methods
- Helper Methods
- aMethod
- Other Type of Methods
- anotherMethod
Private Methods
- Some Type of Method
- aPrivateMethod
这可能吗?
最佳答案
只需在主要部分前后使用 -
将其包围在行中,排除子部分的破折号,然后方法名称将一如既往地显示。
#pragma mark - Public Methods -
#pragma mark Helper Methods
- (void)aMethod{}
#pragma mark Other Type of Methods
- (void)anotherMethod{}
#pragma mark - Private Methods -
#pragma mark Some Type of Method
- (void)aPrivateMethod{}
关于objective-c - 是否有可能有一个 "#pragma mark"层次结构?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13128648/