objective-c - 是否有可能有一个 "#pragma mark"层次结构?

标签 objective-c xcode categories pragma

我经常使用 #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{}

enter image description here

关于objective-c - 是否有可能有一个 "#pragma mark"层次结构?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13128648/

相关文章:

ios - 尝试在 iPad 或更小的屏幕上显示时出现自动布局问题

wordpress - 如何在视觉 Composer 中添加多选类别

iphone - 我如何利用 NSCoding 将对象转换为 NSDictionary ?

ios - 调试一个奇怪的崩溃 - NSInternalInconsistencyException

ios - CAAnimation 获取动画属性的实时更新

ios - 改变限制

ios - 在 UIWebView 中加载受密码保护的 PDF

ios - 如何根据 iPhone 尺寸在 Splash 中设置不同的约束?

php - MySQL/PHP : Fetch multiple values from 1 column in Database

magento - 如何在管理端显示所有(产品)类别列表 : Magento