Header file declaration in iPhone
Approach 1:-
@interface EffortView : UIView {
}
@property (nonatomic, retain) UIView *homeV开发者_如何学Pythoniew;
@end
Approach 2:-
@interface EffortView : UIView {
UIView *homeView;
}
@property (nonatomic, retain) UIView *homeView;
@end
I have synthesized the properties in both cases. Both of them works. I am using Xcode 4.0 on Mac 10.6.6
Please enlighten me.
Thank you All.
The first approach won't work on 32-bit Mac OS X runtimes because each property must have a corresponding instance variable. 64-bit and iOS runtimes automatically create the instance variable for you, so in that case, it is enough to use the second approach.
The bottom line is: if you are 100% sure that you won't ever target 32-bit Mac OS X systems and none of the components of your software will ever be used on that platform, you can safely omit the instance variables.
精彩评论