Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Dumb question ...Hillegass book question

Dumb question ...Hillegass book question
Thread Tools
Addicted to MacNN
Join Date: May 2001
Location: Atlanta, GA
Status: Offline
Reply With Quote
Mar 26, 2005, 11:04 PM
 
How does one wire up the challenge on 119 ?? (The resize delegate?)

I can't seem to figure out how to set the outlet for this.

Any shoves in the right direction would be useful. Thanks.
- iMac 3.2Ghz 1TB - MacBook Pro 15" Core i7 2.3Ghz / 256SSD (Work laptop)
- PowerMac G5 - Dual 2.0 Ghz, 3GB, Soundsticks!,
- Lenovo Thinkpad T510 (also a work laptop), Win 7 Enterprise, 8GB, 320GB HDD
     
Mac Elite
Join Date: Jul 2002
Status: Offline
Reply With Quote
Mar 27, 2005, 12:29 AM
 
Yeah, I never figured this one out either.
     
driven  (op)
Addicted to MacNN
Join Date: May 2001
Location: Atlanta, GA
Status: Offline
Reply With Quote
Mar 27, 2005, 12:55 AM
 
It's frustrating because the challenge comes just when you feel like you have a handle on things.
- iMac 3.2Ghz 1TB - MacBook Pro 15" Core i7 2.3Ghz / 256SSD (Work laptop)
- PowerMac G5 - Dual 2.0 Ghz, 3GB, Soundsticks!,
- Lenovo Thinkpad T510 (also a work laptop), Win 7 Enterprise, 8GB, 320GB HDD
     
Senior User
Join Date: Feb 2003
Location: USA
Status: Offline
Reply With Quote
Mar 27, 2005, 06:34 AM
 
If you want to see what others have done about the challenge you can go here and put in the page number:

http://www.bignerdranch.com/products/cocoa1.shtml

But if you want to figure it out on your own...just make sure you've set the outlet to the window and also the delegate, then simply implement the windowWillResize:toSize delegate method.
MacBook 2.0 160/2GB/SuperDrive
Lots of older Macs
     
driven  (op)
Addicted to MacNN
Join Date: May 2001
Location: Atlanta, GA
Status: Offline
Reply With Quote
Mar 27, 2005, 08:46 AM
 
Thanks ... this might be helpful. (Seriously ... the link may be invaluable!)

Unfortunately I have to fly out tonight to Anaheim. As soon as I return I'll give these a try!
- iMac 3.2Ghz 1TB - MacBook Pro 15" Core i7 2.3Ghz / 256SSD (Work laptop)
- PowerMac G5 - Dual 2.0 Ghz, 3GB, Soundsticks!,
- Lenovo Thinkpad T510 (also a work laptop), Win 7 Enterprise, 8GB, 320GB HDD
     
driven  (op)
Addicted to MacNN
Join Date: May 2001
Location: Atlanta, GA
Status: Offline
Reply With Quote
Mar 28, 2005, 03:17 AM
 
Originally posted by techtrucker:
If you want to see what others have done about the challenge you can go here and put in the page number:

http://www.bignerdranch.com/products/cocoa1.shtml

But if you want to figure it out on your own...just make sure you've set the outlet to the window and also the delegate, then simply implement the windowWillResize:toSize delegate method.
Pointed question: How do you set the outlet to the window? I've added the outlet in the header (.h) file, but where do I drag/drop in IB? I've tried all obvious possibilities.
- iMac 3.2Ghz 1TB - MacBook Pro 15" Core i7 2.3Ghz / 256SSD (Work laptop)
- PowerMac G5 - Dual 2.0 Ghz, 3GB, Soundsticks!,
- Lenovo Thinkpad T510 (also a work laptop), Win 7 Enterprise, 8GB, 320GB HDD
     
Senior User
Join Date: Feb 2001
Location: Deer Crossing, CT
Status: Offline
Reply With Quote
Mar 28, 2005, 06:56 AM
 
Originally posted by driven:
Pointed question: How do you set the outlet to the window? I've added the outlet in the header (.h) file, but where do I drag/drop in IB? I've tried all obvious possibilities.
To set the outlet to the Window, CTRL-drag from your controller object to the window's titlebar. Then highlight the proper outlet and click the Connect button.

Also, in order for your controller object to receive notifications from your window, you have to set your controller object as the window's delegate. Do this by CTRL-dragging from the window's titlebar to your controller object. <-- This piece is what wasted a few hours of my time in a project of my own.
20" iMac G5! :D AND MacBook 1.83GHz!
Canon Digital Rebel Kit + 75 - 300mm lens. Yum Yum! :D
Check out my OS X Musical Scales program
     
Senior User
Join Date: Feb 2003
Location: USA
Status: Offline
Reply With Quote
Mar 28, 2005, 05:00 PM
 
PBG4 User is correct...or you could alternatively ctrl-drag from your controller object to the window object in the Instances window. Only difference really is the distance the mouse travels...
So start by ctrl-dragging from your controller object to the window and set the window outlet. Then for the delegate you can drag from the window object to the controller object and connect the delegate, or set the delegate programmatically.
MacBook 2.0 160/2GB/SuperDrive
Lots of older Macs
     
Senior User
Join Date: Feb 2001
Location: Deer Crossing, CT
Status: Offline
Reply With Quote
Mar 28, 2005, 09:09 PM
 
Originally posted by driven:
Pointed question: How do you set the outlet to the window? I've added the outlet in the header (.h) file, but where do I drag/drop in IB? I've tried all obvious possibilities.
One other thing I forgot in my earlier post; you will need to add the new outlet to the object in IB. Just double-click on the object in IB, then change the dropdown to Connections in the Inspector window. Outlets & Actions will be shown here. Just click the Outlets tab, then click the add button to add the outlet to the object in IB.

Once you've done this, the outlet will be available for connection in IB.
20" iMac G5! :D AND MacBook 1.83GHz!
Canon Digital Rebel Kit + 75 - 300mm lens. Yum Yum! :D
Check out my OS X Musical Scales program
     
driven  (op)
Addicted to MacNN
Join Date: May 2001
Location: Atlanta, GA
Status: Offline
Reply With Quote
Mar 29, 2005, 01:03 AM
 
Originally posted by PBG4 User:
One other thing I forgot in my earlier post; you will need to add the new outlet to the object in IB. Just double-click on the object in IB, then change the dropdown to Connections in the Inspector window. Outlets & Actions will be shown here. Just click the Outlets tab, then click the add button to add the outlet to the object in IB.

Once you've done this, the outlet will be available for connection in IB.
Of course, you can only do this the first time or else you'll overwrite your code. After that you have to manually code your outlets.

(I really wish I could avoid this drag & drop stuff and just code the same thing ... it seems simplier ... but I'm coming from a Windows programming perspective where I very rarely do drag/drop anything ... even when it's available.)
- iMac 3.2Ghz 1TB - MacBook Pro 15" Core i7 2.3Ghz / 256SSD (Work laptop)
- PowerMac G5 - Dual 2.0 Ghz, 3GB, Soundsticks!,
- Lenovo Thinkpad T510 (also a work laptop), Win 7 Enterprise, 8GB, 320GB HDD
     
Senior User
Join Date: Feb 2001
Location: Deer Crossing, CT
Status: Offline
Reply With Quote
Mar 29, 2005, 05:51 AM
 
Originally posted by driven:
Of course, you can only do this the first time or else you'll overwrite your code. After that you have to manually code your outlets.

(I really wish I could avoid this drag & drop stuff and just code the same thing ... it seems simplier ... but I'm coming from a Windows programming perspective where I very rarely do drag/drop anything ... even when it's available.)
I didn't say to generate the class files, I just said to add the outlet to your object in IB. If you add an action or outlet once you've generated the class files in IB you'll have to manually add them to both your object in IB and your .h file in XCode. You most definitely don't want to regenerate the class files once you've started coding in IB or you'll be playing with the horror that is File Merge.
20" iMac G5! :D AND MacBook 1.83GHz!
Canon Digital Rebel Kit + 75 - 300mm lens. Yum Yum! :D
Check out my OS X Musical Scales program
     
Professional Poster
Join Date: Sep 1999
Location: Ottawa, ON, Canada
Status: Offline
Reply With Quote
Mar 29, 2005, 08:37 AM
 
Originally posted by PBG4 User:
I didn't say to generate the class files, I just said to add the outlet to your object in IB. If you add an action or outlet once you've generated the class files in IB you'll have to manually add them to both your object in IB and your .h file in XCode. You most definitely don't want to regenerate the class files once you've started coding in IB or you'll be playing with the horror that is File Merge.
I just reimport my .h files into IB after I make the change. It has never dropped an existing connection yet.
     
driven  (op)
Addicted to MacNN
Join Date: May 2001
Location: Atlanta, GA
Status: Offline
Reply With Quote
Mar 29, 2005, 09:22 AM
 
Originally posted by hayesk:
I just reimport my .h files into IB after I make the change. It has never dropped an existing connection yet.
That's the way that the book recommends doing it. I wasn't even aware that there was another way.

(That's why I love this forum .... learn something new every 10 minutes really.)
- iMac 3.2Ghz 1TB - MacBook Pro 15" Core i7 2.3Ghz / 256SSD (Work laptop)
- PowerMac G5 - Dual 2.0 Ghz, 3GB, Soundsticks!,
- Lenovo Thinkpad T510 (also a work laptop), Win 7 Enterprise, 8GB, 320GB HDD
     
Senior User
Join Date: Feb 2001
Location: Deer Crossing, CT
Status: Offline
Reply With Quote
Mar 29, 2005, 10:48 AM
 
Originally posted by hayesk:
I just reimport my .h files into IB after I make the change. It has never dropped an existing connection yet.
I didn't realize you could import .h files into IB! *flies off bridge* I just added the outlet in the .h file in XCode then added to the object in IB. Guess I should get this Hillegass book at some point.
20" iMac G5! :D AND MacBook 1.83GHz!
Canon Digital Rebel Kit + 75 - 300mm lens. Yum Yum! :D
Check out my OS X Musical Scales program
     
Professional Poster
Join Date: Sep 1999
Location: Ottawa, ON, Canada
Status: Offline
Reply With Quote
Mar 29, 2005, 01:11 PM
 
Originally posted by PBG4 User:
I didn't realize you could import .h files into IB! *flies off bridge* I just added the outlet in the .h file in XCode then added to the object in IB. Guess I should get this Hillegass book at some point.
Yep, it's "read class.h" file in the menu, or just drag it from XCode into the IB window.
     
Senior User
Join Date: Feb 2003
Location: USA
Status: Offline
Reply With Quote
Mar 29, 2005, 02:52 PM
 
Yeah, I too use the "read bla.h" all the time, in some pretty complicated apps, so far so good. Sometimes I hate having to manually add outlets and actions for new controls in the header, but I've gotten used to it.
Let us know when you get the challenge figured out!
MacBook 2.0 160/2GB/SuperDrive
Lots of older Macs
     
driven  (op)
Addicted to MacNN
Join Date: May 2001
Location: Atlanta, GA
Status: Offline
Reply With Quote
Mar 29, 2005, 08:47 PM
 
Originally posted by hayesk:
Yep, it's "read class.h" file in the menu, or just drag it from XCode into the IB window.
Wow! I never saw that menu item. I just assumed I always had to be in drag!
- iMac 3.2Ghz 1TB - MacBook Pro 15" Core i7 2.3Ghz / 256SSD (Work laptop)
- PowerMac G5 - Dual 2.0 Ghz, 3GB, Soundsticks!,
- Lenovo Thinkpad T510 (also a work laptop), Win 7 Enterprise, 8GB, 320GB HDD
     
Mac Enthusiast
Join Date: Apr 2003
Location: manticore or people's republic of haven
Status: Offline
Reply With Quote
Mar 29, 2005, 09:32 PM
 
Originally posted by driven:
How does one wire up the challenge on 119 ?? (The resize delegate?)

I can't seem to figure out how to set the outlet for this.

Any shoves in the right direction would be useful. Thanks.
how 'bout another question some might consider . . . ignorant (as yours sounds like 'tis not dumb) . . . which hillegass book would this be referring to?
some people are like slinkys: they don't do much, but are fun to push down stairs.
     
driven  (op)
Addicted to MacNN
Join Date: May 2001
Location: Atlanta, GA
Status: Offline
Reply With Quote
Mar 29, 2005, 09:41 PM
 
Originally posted by zanyterp:
how 'bout another question some might consider . . . ignorant (as yours sounds like 'tis not dumb) . . . which hillegass book would this be referring to?
Cocoa programming for Mac OSX ... Second Edition
Aaron Hillegass
ISBN 0-321-21314-9
Addison-Wesley Pearson Education
- iMac 3.2Ghz 1TB - MacBook Pro 15" Core i7 2.3Ghz / 256SSD (Work laptop)
- PowerMac G5 - Dual 2.0 Ghz, 3GB, Soundsticks!,
- Lenovo Thinkpad T510 (also a work laptop), Win 7 Enterprise, 8GB, 320GB HDD
     
Mac Enthusiast
Join Date: Apr 2003
Location: manticore or people's republic of haven
Status: Offline
Reply With Quote
Mar 29, 2005, 09:58 PM
 
Originally posted by driven:
Cocoa programming for Mac OSX ... Second Edition
Aaron Hillegass
ISBN 0-321-21314-9
Addison-Wesley Pearson Education
thanks
some people are like slinkys: they don't do much, but are fun to push down stairs.
     
Senior User
Join Date: Feb 2001
Location: Deer Crossing, CT
Status: Offline
Reply With Quote
Mar 30, 2005, 07:36 AM
 
Is this challenge in the first edition of the book? If I already own the first edition would it be worth it to get a copy of the 2nd edition?
20" iMac G5! :D AND MacBook 1.83GHz!
Canon Digital Rebel Kit + 75 - 300mm lens. Yum Yum! :D
Check out my OS X Musical Scales program
     
driven  (op)
Addicted to MacNN
Join Date: May 2001
Location: Atlanta, GA
Status: Offline
Reply With Quote
Mar 30, 2005, 08:33 AM
 
Originally posted by PBG4 User:
Is this challenge in the first edition of the book? If I already own the first edition would it be worth it to get a copy of the 2nd edition?
I believe that there are a lot of changes in the 2nd edition. I am not sure what they are. ( I do distinctly remember one chapter where he said "Folks in edition 1 did this differently.) ... but I can't remember which chapter.

Personally I'm hoping for an edition 3 that covers XCode 2.0. <smile> (And maybe Coredata)
- iMac 3.2Ghz 1TB - MacBook Pro 15" Core i7 2.3Ghz / 256SSD (Work laptop)
- PowerMac G5 - Dual 2.0 Ghz, 3GB, Soundsticks!,
- Lenovo Thinkpad T510 (also a work laptop), Win 7 Enterprise, 8GB, 320GB HDD
     
Senior User
Join Date: Feb 2003
Location: USA
Status: Offline
Reply With Quote
Mar 30, 2005, 04:54 PM
 
Yeah, and maybe more on Bindings too, still haven't fully got a handle on them yet...
MacBook 2.0 160/2GB/SuperDrive
Lots of older Macs
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 07:22 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2