How to define Outlets and Actions in the Classes Pane in Interface Builder in Xcode 4?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-23 12:39:00

问题


In Xcode 3 one used to be able to define Outlets, Actions etc in Interface Builder by going to the Library > Classes Pane and selecting the class from the list. Is this functionality missing in Xcode 4 ?

There is a File Template Library in the Utility area (Lower Right Corner) in Xcode 4 but my custom clases do not show here !!


回答1:


This does appear to be removed from Xcode 4, but there isn't much need for it anymore since Xcode 4 integrates the editor directly with IB. The feature never really worked that well in Xcode 3 IMO anyway.

In Xcode 4, display the header for your object by selecting your object and View>Editors>Assistant. Now control-drag from the object you want to connect into the header. This will let you automatically create an outlet or action and bind it all at once.

See the Xcode 4 Transition Guide for more information.




回答2:


agreed with Rob on that, alternative is to right click your Object in xcode's IB and this will give allow you to select actions/reference etc by means of dragging and dropping



来源:https://stackoverflow.com/questions/6127121/how-to-define-outlets-and-actions-in-the-classes-pane-in-interface-builder-in-xc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!