iphone - @property @synthesize

标签 iphone

@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/

相关文章:

iphone - 我如何获得当前日期?

iphone - Html 表单和移动网络浏览器问题

iphone - 在 View 上使用drawInRect?

iphone - 如何放大 Storyboard(xcode 6)

iphone - 将日期转换为 UTC 格式

ios - Enterprise build 不是通过服务器安装,而是可以通过 dropbox 安装

iphone - 内存警告后自定义 UITableView headerView 消失

iphone - 在 Objective C 中直接访问 iVariable 是一个好方法吗?

iphone - 解码字符串时获取垃圾和特殊字符

iphone - 适用于 Android 和 iPhone 的 OpenGL