天天看点

[Beginning iOS 7 Development] Outlets

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的显示。

  更多精彩请关注微信公众号:兔贩子

[Beginning iOS 7 Development] Outlets
iOS