我對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