I am new to programming on MAC. I have done programming on iOS but using storyboards so not very familiar with the xib format that was used earlier.
I want to achieve this very basic this that i am not able to figure out how.
-
How to navigate to different windows ?
-
How to set actions of the button ie: how to set a button click event or button rollover event?
-
What is the meaning of linking a button from the interface builder to the first responder or to the Application or file owner.
-
Do we have to set the class for each xib as we do in storyboard for iOS?
Thanks a lot .
On the Mac, many windows can be visible at the same time, so you don’t navigate between them as such, you show them and hide them, perhaps bring them to the front etc. Exactly what you do depends on the situation.
You set an action for a button by control clicking the button in the xib and dragging to the controller object you want to handle it. You can then select an
IBActionmethod to perform when the button is clicked (you must define the actions in the class’s header file first). For tracking mouse-over events, look atNSViews-addTRackingRect:owner:userData:assumeInside:method. That might help.That just determines which object gets the action message.
No. Any object can load a xib and make itself the owner
Some resources
Apple’s Window Programming Guide
Apple’s Sheet Programming Guide (sheets are the windows that appear attached to the top of other windows e.g. things like open and save panels.
Cocoa Programming for Mac OS X, Aaron Hillegass (I learned Cocoa from the first edition of this book).