06-30-2008, 01:15 AM #1
stuck following cocoa / xcode tutorial
- Member Since
- Jun 30, 2008
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.
06-30-2008, 03:39 PM #2
- Member Since
- Jun 25, 2005
- On the road
- 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.CameraTime - Time lapse photography for novice and advanced users.
When asking questions, post the version of your software. You'll receive better answers.
Please post your results to the thread as it is good feedback.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
By JohnEH in forum OS X - Development and DarwinReplies: 5Last Post: 09-05-2012, 06:16 PM
By marshaboggs in forum OS X - Development and DarwinReplies: 0Last Post: 04-14-2009, 06:03 PM
By osa in forum OS X - Development and DarwinReplies: 2Last Post: 07-03-2008, 03:06 AM
By mr..nemo in forum OS X - Development and DarwinReplies: 0Last Post: 04-26-2005, 06:05 AM
By dim in forum OS X - Development and DarwinReplies: 1Last Post: 10-20-2004, 11:59 PM