View Full Version : in Xcode 4, where can I find the "class" button in the Library window?
Aug 10, 2011, 11:17 AM
In Xcode 3.2, we can see a "class" button in the Library window. It allows us to view the classes and we are able to use the editing area at the bottom to add Actions or Outlets in the interface without necessary to manually write the codes.
But It seems I can't find anything similar in Xcode 4 (and i couldn't find the similar discussion on the web). Anyone know this?
Thank you very much.
Aug 10, 2011, 02:45 PM
When you're viewing an XIB in XCode 4, look at the top right of the window.
There should be a segmented control with the word "View" underneath. Click the third button from the segmented control, and it should bring up the Utility plane on the right side of the window. There's a part of the Utility plane that slides up and down, and on it there are four icons. The first icon is a file, the second is two curly braces, the third is a cube, and the fourth is a film strip. Select the cube. I believe that'll reveal what you're looking for.
Aug 11, 2011, 12:52 AM
Thanks ArtOfWarfare for the detailed answer.
Unfortunately, this is not what I was asking. I already know how to bring up the Utility panel and show the objects. What I was asking is how to switch to the "Class" tab and "use the lower panel" (see the image) to automatically insert the code for IBActions and IBOutlets. In XCode 4, such function is hard to find.
Finally I got the answer from another forum. Here I can share the info:
1: open the Assistant window and let it display the .h contents.
2: from the xib window, hold and press the CTRL key, drag a line from the object (e.g. a button) to the .h file. Release the line in an appropriate place.
3: It would show a small prompt box so you can input Outlets or Actions. What's even better is that it even allows you to connect this action with a button event (e.g. touch up inside) in one go.
For more details, you may search the help article: Create and Manage Connections in Interface Builder
Thanks jzc0411 for the answer in another forum (quote: http://dev.iphonetw.net/viewthread.php?tid=5830&page=1&extra=#pid33147)
Hope that helps people...