@synthesize
和 @property
在 Xcode 中做什么?请用非常简单的术语进行解释?
最佳答案
您要求简单的术语:
@property declares a property in your class header
@property (nonatomic, retain) NSString *myString;
@synthesize creates your setter and getter for your property (accessor methods)
Without synthesize you have to write your own setter and getter implemention, like getMyString or setMyString (capitalize the first character of your property)
Sam:只是一个建议:http://www.cocoadevcentral.com/d/learn_objectivec/是学习属性等基础知识的非常可靠的资源。
祝你好运!
关于iphone - @property @synthesize,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2032826/