Think of an outlet as a pointer that points to an object within the user interface. For example, suppose you created a text label in Interface Builder (as we did in Chapter 2) and wanted to change the label’s text from within your code. By declaring an outlet and connecting that outlet to the label object, you would then be able to use the outlet from within your code to change the text displayed by the label.
Outlet是可以理解为一个指向UI中得一个对象的指针。举例来说,你在Interface Builder界面创建了一个text label,并且你想通过代码来改变label。通过声明一个outlet并且连接outlet和label,你就可以修改代码,通过outlet来改变label的显示。
更多精彩请关注微信公众号:兔贩子
本文解释了在iOS开发中如何使用Outlets连接用户界面元素与代码,通过具体实例介绍了如何利用Outlets来动态更新界面上的文字标签。
122

被折叠的 条评论
为什么被折叠?



