所以这两种版本之间有什么区别呢?
@interface Foo : NSObject
// A guy walks into a bar.
@property(nonatomic, copy) NSString *bar;
@end
// Implementation file
@interface Foo ()
@property(nonatomic, retain) NSArray *baz;
@end
和
@interface Foo : NSObject
// A guy walks into a bar.
@public
@property(nonatomic, copy) NSString *bar;
@private
@property(nonatomic, retain) NSArray *baz;
@end
As far as my underst和ing goes, putting the @property in the .m basically means that it is private. Correct me if I am wrong? Also which is the best implementation then? Is it just a coding style/practice?