Stuck on CocoaDevCentral.com Cocoa tutorial

Moderator
Posts: 682
Joined: 2002.11
Post: #1
For reference, I will be talking about this tutorial.

I started working through some Cocoa tutorials today. I'm having a problem with one - it uses Xcode 2.4. Xcode 3.1 does an important step differently - in particular, getting classes into Interface Builder and tying them to interface elements

Is there a quick way to explain the differences in Xcode 3.1 as it relates to the Learn Cocoa II tutorial? I've been able to figure out the new interface up through adding a class to IB, but I'm stuck at creating an instance and connecting it to the NSTextView (part 13).

If I knew what "connecting" things in IB actually did, I could probably fumble through it. Later steps seem to indicate that it just makes the AppController a subclass of NSTextView. If I knew enough Obj-C, I'd do it in the code, but I don't trust myself not to screw everything up, since a lot of the work is being done in the GUI.

Could anyone give me a push in the right direction? Is there an overview of IB changes from 2.4-3.x somewhere that doesn't assume too much about the reader's Cocoa knowledge?

I may cross-post this to iDevApps, but my eventual aim is to make games with Cocoa, and iDG seems to get more traffic.

My web site - Games, music, Python stuff
Quote this message in a reply
Moderator
Posts: 3,574
Joined: 2003.06
Post: #2
You can go through the cocoa tutorial at Apple to get an up-to-date run-through of how things go. Here's a link to where they talk about IB in that tutorial:

http://developer.apple.com/documentation...3-CH7-SW15

I would suggest going through their entire tutorial rather than trying to piece things together on your own, but it's your call.
Quote this message in a reply
Moderator
Posts: 623
Joined: 2007.09
Post: #3
Go to the IB palette list and find NSObject(It's a blue cube). Drag it into your nib file. Then hit Command-6 to go to the Identity Inspector. You can choose the class you made in XCode from the pop-up menu. Once that is done, it will represent your class, and you can make your connections.

Disregard this if I am interpreting your question wrongly(A definite possibility).

Oh, and I think you're right about IDG vs IDA Wink

- Lincoln Green
http://www.binkworks.com/
Quote this message in a reply
Moderator
Posts: 682
Joined: 2002.11
Post: #4
AnotherJake Wrote:You can go through the cocoa tutorial at Apple to get an up-to-date run-through of how things go.
Yeah, I've been there, but Apple's tutorials tend to put me to sleep rather than enlighten me. CocoaDevCentral has many more pretty pictures.

Thanks, Hairball, I think you answered my question. I'll get back to you tomorrow - working full time sucks my soul away if I don't let my brain idle a bit at home.

My web site - Games, music, Python stuff
Quote this message in a reply
Moderator
Posts: 3,574
Joined: 2003.06
Post: #5
diordna Wrote:Yeah, I've been there, but Apple's tutorials tend to put me to sleep rather than enlighten me. CocoaDevCentral has many more pretty pictures.

I really don't want to be a stick in the mud and take the fun out of it, but the truth is that you will spend a large amount of your time in the future reading Apple documentation to figure stuff out, so it's helpful to get used to it early on. I hate to tell you this, but if it puts you to sleep now, it only gets worse from here... Sad

If I knew of a source that worked beginners through Cocoa and IB 3, I'd recommend that instead, but I am unaware of such a tutorial at this time.
Quote this message in a reply
Moderator
Posts: 623
Joined: 2007.09
Post: #6
All I use the docs for is for class references. Is there anything else?

- Lincoln Green
http://www.binkworks.com/
Quote this message in a reply
Moderator
Posts: 3,574
Joined: 2003.06
Post: #7
Yes, there are programming guides and tutorials and tech notes and specifications which you will need at some point or another for various purposes. I don't have clairvoyance for my own needs, so I definitely can't tell you anything more than that for your own. If you can connect the dots all on your own through references then great, but many of us out here do need some extra information from time to time. And this is apparently so, otherwise Apple wouldn't have made them in the first place. Wink
Quote this message in a reply
Moderator
Posts: 623
Joined: 2007.09
Post: #8
I do use the guides. I could never find anything else though, unless someone gave me a specific link.

- Lincoln Green
http://www.binkworks.com/
Quote this message in a reply
Moderator
Posts: 682
Joined: 2002.11
Post: #9
I didn't mean I never wanted to see another piece of Apple documentation again. I just meant that I would prefer a tutorial like this to Apple's method. It's much easier to stay engaged by building apps than by reading 50 pages of documentation before touching Xcode.

My web site - Games, music, Python stuff
Quote this message in a reply
Moderator
Posts: 3,574
Joined: 2003.06
Post: #10
I sympathize. I really do, but there just isn't anything else out there yet (that I've heard of). Maybe you should write a tutorial on how to use IB 3 with existing tutorials once you get it figured out? I bet it'd be pretty popular!
Quote this message in a reply
Moderator
Posts: 682
Joined: 2002.11
Post: #11
AnotherJake Wrote:I sympathize. I really do, but there just isn't anything else out there yet (that I've heard of). Maybe you should write a tutorial on how to use IB 3 with existing tutorials once you get it figured out? I bet it'd be pretty popular!
Except that there is. It's what I linked to in the first post. It just needed that one tweak.

My web site - Games, music, Python stuff
Quote this message in a reply
Moderator
Posts: 3,574
Joined: 2003.06
Post: #12
Glad you figured it out!

I was talking about the fact that there isn't anything out there (that I know of) which walks you through the beginnings of Cocoa and IB 3 (yet). That tutorial you linked to does not use IB 3. I am sorry that I made the assumption (based on my scan of the tutorial) that it would be more than just one tiny little tweak that you were missing and instead suggested that you read something else entirely.
Quote this message in a reply
Moderator
Posts: 682
Joined: 2002.11
Post: #13
Ah, I see what you mean. I haven't actually tried Hairball's tweak yet, but it sounds like it should work. If I can figure this out, then others can too. I don't want to write my own tutorial because putting all the screenshots with arrows together is a pain. The one I linked to has it all done very nicely.

My web site - Games, music, Python stuff
Quote this message in a reply
Moderator
Posts: 623
Joined: 2007.09
Post: #14
Glad to help.

- Lincoln Green
http://www.binkworks.com/
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  stuck in opengl fullscreen mode pikmini 6 6,125 May 18, 2009 08:35 AM
Last Post: mikey