Created
February 8, 2014 09:33
-
-
Save yukinaga/8880259 to your computer and use it in GitHub Desktop.
Objective-Cでは、インスタンス変数をどこに宣言するのが正しいのか? ref: http://qiita.com/yuky_az/items/f2c3db2796d0a73dfde2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
インスタンス変数は実装詳細であり、通常、クラス自身の外からアクセスされることはあり | |
ません。さらに、実装ブロック内に宣言すること、あるいは宣言済みプロパティから自動生 | |
成させることも可能です。したがって通常は、インスタンス変数宣言をパブリックインター | |
フェイスで行うべきではないので、波括弧も省略してください。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation ViewController{ | |
IBOutlet UILabel *label; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface SampleClass : NSObject{ | |
IBOutlet UILabel *label; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface ViewController (){ | |
IBOutlet UILabel *label; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment