LLVM と Clang を使うと次のことができるらしい。 ・@synthesize の省略 ・Class Extensions でインスタンス変数定義 元ネタはここから。 M Cubed Software - Blog 設定方法はターゲットのビルド設定を開き2つの設定を行う。 1つはコンパイラの指定。 -Xclang -fobjc-nonfragile-abi2 を指定する。 すると下記のコードがコンパイルできるようになる。 SampleModel.h @interface SampleModel : NSObject { } @end SampleModel.m #import "SampleModel.h" @interface SampleModel() { NSString* name; } @property (nonatomic, copy) NSString* name;
![Cocoaの日々: @synthesize default と Class Extensions Variables](https://cdn-ak-scissors.b.st-hatena.com/image/square/b4b4a9922ec538d6e424aa20d10dd6907543cf68/height=288;version=1;width=512/http%3A%2F%2F3.bp.blogspot.com%2F_ZoUhefzk0CI%2FTP8TamovGeI%2FAAAAAAAAF6Y%2FZF9AjLYL56A%2Fs1600%2F101208-0023.png)