当前位置: 代码迷 >> Iphone >> IBOutlet是啥门类
  详细解决方案

IBOutlet是啥门类

热度:59   发布时间:2016-04-25 06:11:01.0
IBOutlet是啥类型?

@property (retain) IBOutlet UISlider *slider;


以上在UISlider前面出现的IBOutlet这个东东,虽然知道这是表示变量与控件的对应关系的,但它的位置很奇怪啊。这个IBOutlet是啥,对象?关键字?
------解决方案--------------------
只是给IB用的,实际定义为空
------解决方案--------------------
IBOutlet用来声明一个成员可以链接到xib的一个控件。
链接之后,对使用IBOutlet声明的成员操作就是对xib中控件的操作。
其实我觉得就是在初始化IBOutlet声明成员的时候,使用了设计器中链接的控件参数作为参数。。。。

官方:
IBOutlet
Identifier used to identify a property so Interface Builder can synchronize the display and connection of outlets with Xcode. Insert this identifier immediately before the type in any declarations. For examples, including how to use it with the @property syntax, see “Xcode Integration”
------解决方案--------------------
一旦标明了IBOutlet,在zib文件里就会有对应的接口
IBOutlet只是标识而已
  相关解决方案