我对Objective-C的新世界很陌生,所以我有几个关于集体成员声明的问题。请注意在下面的代码中的注释:关于集体成员声明的问题
在头文件中我有代码,
@interface MyClass : NSObject {
//what we points here ? Object or something else ?
NSString *myString;
}
// In interface we declare NSTring *myString in @property declaration is (NSString *) myString.
// What is the difference here ? Why we don`t use the same declaration as above ?
@property(nonatomic, retain) (NSString *) myString;
@end
为什么我们写: @property(非原子,保留)(的NSString * )myString,而不是 @property(nonatomic,retain)NSString * myString; ? – prista 2011-03-09 11:10:45
因此可以从外部对象访问它。 – Eimantas 2011-03-09 11:12:12