什么时候需要@property和@synthesize? [英] When is @property and @synthesize needed?

查看:103
本文介绍了什么时候需要@property和@synthesize?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么时候我必须添加 @property(nonatomic,retain) @synthesize ?另外,什么时候声明 IBOutlet someObject 呢?如果没有@property& amp,我怎么能设置/获取UILabel值? @合成?它取决于UI对象类型吗?

When exactly do I have to add @property (nonatomic, retain) and @synthesize? Also, when is declaring IBOutlet someObject enough? How is it that I can set/get UILabel value without @property & @synthesize? Does it depend on UI object type?

是的,我已经阅读了关于这2个的类似问题:)

And yes, I have read similar questions about these 2 :)

推荐答案

强烈推荐阅读:使用Objective-C教程中的属性

这篇关于什么时候需要@property和@synthesize?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆