Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
415 views
in Technique[技术] by (71.8m points)

objective c - Is it possible to have a "#pragma mark" hierarchy?

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

    • Helper Methods
      • aMethod
    • Other Type of Methods
      • anotherMethod
  • Private Methods

    • Some Type of Method
      • aPrivateMethod

Is this possible?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...