PDA

View Full Version : Ib 3




garethlewis2
Oct 29, 2007, 10:37 AM
Simple scenario, single document interface program. Not MDI.

IB 2, you create the class Contoller by subclassing NSObject in the Classes tab.

IB 3. There is no classes tab, so you can't create the controller class that way anymore. How are you supposed to do this now?



kainjow
Oct 29, 2007, 11:19 AM
Drag over an Object:

89329

eulerthegrape
Oct 29, 2007, 01:41 PM
I am a total n00b and ran into a similar issue to the OP. Apple issued the "Xcode Quick Tour Guide" with Xcode 3.0 but, seemingly, uses Interface builder 2.0. I'm trying to mindlessly follow the tutorial to create a hello world app but quickly hit a wall. It won't let me drag the object icon and change its type.

They say to:

1. Open MainMenu.nib in Interface Builder
2. Create the HelloView class:
a. In the MainMenu.nib window, click Classes.
b. in the tree view, select NSObject > NSResponder > NSView.
c. Choose Classes > Subclass NSView.
d. Change MyView to HelloView and press Return.
e. choose Classes > Create Files for HelloView.

etc.

1. is their an updated tutorial somewhere that uses InterfaceBuilder 3 or can someone with the tutorial take a look and show me how to implement this program with the new InterfaceBuilder. I would really appreciate any help as I was really excited about trying out Xcode and I'd hate to stop now before I got started.

-Pete

kainjow
Oct 29, 2007, 01:57 PM
a. In the MainMenu.nib window, click Classes.
b. in the tree view, select NSObject > NSResponder > NSView.
c. Choose Classes > Subclass NSView.
d. Change MyView to HelloView and press Return.
e. choose Classes > Create Files for HelloView.


In Interface Builder 3, try:

1. In the Library window (Tools > Library), select Library > Cocoa, then scroll to Custom View (second to last row).
2. Drag the icon for Custom View into your nib, alongside File's Owner, First Responder, Application and MainMenu.
3. Select your view, go to the Identity Inspector (Tools > Identity Inspector), and change the Class from NSView to HelloView.
4. Choose File > Write Class Files...

eulerthegrape
Oct 29, 2007, 02:44 PM
OK, that was very helpful I think the key there is where to add the new custom type (alongside the File's Owner, First Responder etc.). Now I added a Custom View to the window and changed it's type to HelloView. I added these files to my Xcode project (is there another way to do this than going into finder and pulling the HelloView.h and .m files over?) but when I opened the files the .m file it was empty and the project would not compile. Sorry if this is trivial.

garethlewis2
Oct 30, 2007, 04:44 AM
Got it working.

Completely different to previous versions of IB.

Next month I am going to be slapping down $500 to get ADC select then find every single piece of information there is on Leopard development.

It does make sense now, but it is confusing. I had to create the ConverterController class and Converter class in XCode, basically empty. Then drag both header files along to IB3 so when I added the two NSObjects, I could select the type they were. That is going to cause a lot of headaches with developers used to XCode 2.

kainjow
Oct 30, 2007, 07:58 AM
Next month I am going to be slapping down $500 to get ADC select then find every single piece of information there is on Leopard development.

I don't know if you'll need to do that now. It seems like they are opening up more of the articles and documentation to the public and I'm sure in a month's time there will be even more available. But if you're going to WWDC 08 it's worth it :D

benuaq
Apr 19, 2008, 03:34 PM
Sorry for replying on such an old/dead thread, but I'm having real trouble with this.

I've been following this tutorial:
http://www.cocoadevcentral.com/d/learn_cocoa_two/

I've got to section 12, "Add Header to NIB"
I follow the suggestions you guys have made, about making a new Custom View and dragging across the .h file

I can't tell if anything has happened after dragging the file across, as nothing seems to change.

If I change the "Class" section of my new Custom View to the class AppController, it makes the error sound and goes back to being blank.

I would really appreciate any help, I've been writing mac apps for almost 2 hours now, I'm such a noob xD