是否有可能带有“ #pragma标记”?等级制度? [英] Is it possible to have a "#pragma mark" hierarchy?

查看:81
本文介绍了是否有可能带有“ #pragma标记”?等级制度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我经常使用 #pragma标记-描述在Xcode中组织我的方法。但是,我发现有时需要为我的方法分类和子分类,例如:

I use #pragma mark - Description frequently to organize my methods in Xcode. However, I find that sometimes I need to categories and subcategories for my methods, like this:



  • 公共方法

  • Public Methods


  • 辅助方法

    • aMethod


    • anotherMethod

    私有方法


    • 某些方法类型

      • aPrivateMethod

      这可能吗?

      推荐答案

      简单仅在主部分前后使用-将其用行包围,不包括小节的破折号,然后方法名称将始终显示。

      Simply only use the - before and after your main section to surround it in lines, exclude the dash for the subsections, and then the method names will show as always.

      #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{}
      







      这篇关于是否有可能带有“ #pragma标记”?等级制度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆