Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

slooksterPSV

macrumors 68040
Original poster
Apr 17, 2004
3,544
306
Nowheresville
I'm stuck on Challenge 5 and I'm not sure what to do on it exactly. Here's what it asks you to do:
--The chapter talks about delegates, maybe I don't completely understand them either:

Delegates are a way of using a function to tell information about another process/function that is executing. For example, you create a synthesizer and if its playing, when you click the stop button, if the synthesizer wasn't finished then it gives you a NO or 0, otherwise if it did finish it'll give you a 1 without you clicking stop. -- Not exactly, but something to that effect

Now for the challange you have to create an object in the window where it will be the delegate and if the window is resized to an arbitrary size, the height will be twice the width. Now I'm not sure if I should have done this in a button or if a regular text label would work, I'm totally not sure how to do this. It gives you the function to use: - (NSSize)windowWillResize:(NSWindow *)sender toSize:(NSSize)frameSize;

And tells you NSSize has 2 properties, I think they were width and height. if someone can give me some pointers on how to do it (not the complete answer) then that'd be great. Thanks you guys, I want to do well with programming and I just need some advice here and there.
 

slooksterPSV

macrumors 68040
Original poster
Apr 17, 2004
3,544
306
Nowheresville
Duh, I figured it out, you have to link the Window as the delegate since no other item can use the windowWillResize: toSize: method.

I forgot to link Window to my class. I figured it out *hugs* thanks you guys, I know I did it on my own, but thanks still.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.