So I've just started reading the Learning Cocoa book by Aaron Hillegass. I have some experience in Java and enough familiarity with C to understand everything great so far. I'm in Chapter 6 and one of the challenges is to:
"Create a new application with one window. Make an object that is a Delegate of the window. As the user resizes the window, make sure that it always remains twice as tall as it is wide. Here is the signature of the Delegate method you will implement:
- (NSSize)windowWillResize
NSWindow *)sender
toSize
NSSize)frameSize;"
It seems pretty self explanatory and I was able to finish the second and I would assume more difficult challenge that is the to-do list one. I can't seem to wrap my head around the question. I believe I understand how to manipulate NSSize (though I can't test it), but I don't know where to start. Creating an application with only a window should have nothing in the .h file correct? And if so, what do I call in the .m file (i.e. how do I call setDelegate.self on the window)? Thanks in advance.
"Create a new application with one window. Make an object that is a Delegate of the window. As the user resizes the window, make sure that it always remains twice as tall as it is wide. Here is the signature of the Delegate method you will implement:
- (NSSize)windowWillResize
toSize
It seems pretty self explanatory and I was able to finish the second and I would assume more difficult challenge that is the to-do list one. I can't seem to wrap my head around the question. I believe I understand how to manipulate NSSize (though I can't test it), but I don't know where to start. Creating an application with only a window should have nothing in the .h file correct? And if so, what do I call in the .m file (i.e. how do I call setDelegate.self on the window)? Thanks in advance.