简体   繁体   中英

Hiding @synthesize

Let me start by saying I am not sure if this belongs here or at Super User. I started here.

Now, I am a very tidy person, and I like collapsing methods so that I can get around very easily. However, one thing that aggravates me is that all my @synthesize commands are always there. I can see no way to collapse them. (I have over 50 properties to synthesize) Is there a way I can hide these commands, while not messing up my build.

Thanks.

Unfortunately, from "available features" perspective, XCode is a very old IDE. Therefore no foldable code regions - see detailed discussion Xcode regions

Also note that with the latest compiler (LLVM 4.0), declaring @synthesize is optional. You can enable/disable it in compiler settings in your project settings. However, if you are using GCC or an older LLVM version (for whatever reasons), this is not possible.

Edit: After rereading your question... having 50 properties in one class smells very bad. Consider splitting your class into several smaller classes.

You can also put the @synthesize commands to the end of the @implementation file.

从Xcode 4.4开始,如果您不需要其他名称,则不需要@synthesize属性-它使用自动综合

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM