stuck following cocoa / xcode tutorial

Joined
Jun 30, 2008
Messages
1
Reaction score
0
Points
1
I am following the instructions found in the Xcode Quick Tour Guide and am getting stuck right away. Step 2a says "In the MainMenu.nib window, click Classes."

I can not find a "Classes" to click on! So I was searching online trying to figure out where "Classes" should be. I came across this video clip. When they open main.nib in Interface Builder, I see a "main.nib (English)" window with "Instances, Classes, Images, Sounds, and Nib" buttons on the top of the window. The window that I get doesn't have those buttons. How do I get those buttons? I'm looking through all the menus but can't toggle these buttons. What the heck am I doing wrong?


I've got Xcode and Interface Builder v3.0.
 
Joined
Jun 25, 2005
Messages
3,231
Reaction score
112
Points
63
Location
On the road
Your Mac's Specs
2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
It looks like that tutorial is for an older version of Interface Builder. Look for an update or separate tutorial for IB 3. In the Learn Cocoa II on the Cocoadevcentral site, see how it is done now on page 9 where they are creating a subclass. Two lines down from the 'Objective-C class' highlight you would choose 'Objective-C NSView subclass'.

This is what I think I've figured out. Note I haven't used the new XCode and new Interface builder yet to any extent. I'll be looking for updated tutorials.

You seem to need to effectively do step 'e' first.

In XCode, right click Classes and choos Add--> New File...
In the list that pops up, under Cocoa, choose Objective-C NSView subclass.
Click Next on the bottom right.
Change the untitled.m file to HelloView.m and make sure the check box is checked where it says 'Also create HelloView.h".
Click Finish on the bottom right.

You then drag a Custom Siew onto the main window.
Library->Cocoa->Views & Cells->Layout Views

Finally in the Inspector window in the Identity tab (i) you chose your new HelloView class and that is it.

Given all of the above, you might find all of that confusing. I did copy the drawrect code from the tutorial into the HelloView.m file and the program did compile and run properly.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top