Вопрос

We use #pragma mark - StackOverFlow Example in order to organize our Function Menu (the most-inner menu in the implementation navigation menu).

What I want to do is to simplify the Function Menu by removing unwanted directives such as @synthesize or maybe could we use any ignore key to ignore a code segment partially from the Function Menu ?

Это было полезно?

Решение 2

Try to write @synthesize statement in one line.
Then it will show up with only one line.

Другие советы

Well, as of Xcode 4.4 you no longer need to @synthesize your properties. The compiler will do it for you automatically, so you can remove them and therefore remove them from your drop down. Keep in mind you need to be using the LLVM 4.0 compiler for this feature.

@property NSString *string;

Will automatically cause the compiler to do the equivalent of @synthesize string = _string; in your implementation

You can't hide a declaration from the Function menu; it's there to help, not to confuse if something is not listed when it belongs in that file.

As such, there are a couple of options you have:

  1. Remove the @synthesize completely. recent versions of Xcode with LLVM 4.0 means that these directives are no longer required, properties will synthesise themselves. This mightn't be an easy change if you have manually declared the backing instance variable, and reference that throughout your code. i.e.

    @synthesize myProperty = m_myProperty;
    
    m_myProperty = ...;
    
  2. Insert a #pragma mark - before and after the synthesis of your properties, to try and split them away from the other methods.

This is the best you can do I'm afraid, there isn't any other #pragma directives that can remove something from the Function list.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top