 |
 |
Dumb question ...Hillegass book question
|
 |
|
 |
|
Addicted to MacNN
Join Date: May 2001
Location: Atlanta, GA
Status:
Offline
|
|
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
|
|
Yeah, I never figured this one out either.
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: May 2001
Location: Atlanta, GA
Status:
Offline
|
|
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
|
|
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
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: May 2001
Location: Atlanta, GA
Status:
Offline
|
|
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
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: May 2001
Location: Atlanta, GA
Status:
Offline
|
|
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
|
|
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. 
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Feb 2003
Location: USA
Status:
Offline
|
|
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
|
|
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.
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: May 2001
Location: Atlanta, GA
Status:
Offline
|
|
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
|
|
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.
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Sep 1999
Location: Ottawa, ON, Canada
Status:
Offline
|
|
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.
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: May 2001
Location: Atlanta, GA
Status:
Offline
|
|
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
|
|
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. 
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Sep 1999
Location: Ottawa, ON, Canada
Status:
Offline
|
|
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
|
|
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
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: May 2001
Location: Atlanta, GA
Status:
Offline
|
|
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
|
|
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.
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: May 2001
Location: Atlanta, GA
Status:
Offline
|
|
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
|
|
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
|
|
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?
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: May 2001
Location: Atlanta, GA
Status:
Offline
|
|
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
|
|
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
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|