複数のスタイルを持つカスタムビュークラスを作成しています。つまり、一部のプロパティは初期化される場合とそうでない場合があります。毎回使用されるプロパティのみを合成するのが賢明ですか?
例えば:
含まれているプロパティは次のとおりです。
@property (nonatomic, assign) NSUInteger style;
@property (nonatomic, retain) UIImageView *imageView;
@property (nonatomic, retain) UILabel *descriptionLabel;
- (id)initWithStyle:(NSUInteger)style;
スタイルがStyleDefaultの場合、上記のすべてが初期化されて使用されます。スタイルがStyleMinimalの場合、imageViewのみが初期化されて使用されます。
imageViewのみを合成することは良いメモリ管理の習慣ですか?