PDA

View Full Version : Access controls in NSView




satyam90
Nov 29, 2007, 04:43 AM
Hi, I am using Cocoa with Obj-C on XCode 2.4.1
I have a 4 views (with different controls in each of the view) added to NIB and accessing it through Controller. I am able to show different views whenever toolbar buttons are clicked.
I want to set the controls with some default values at the time of showing the view. For setting these controls in views, apart from awakeFromNib & windowDidLoad what are the other methods where I can set the controls. Will there be anything like constructor for view? How to set?

satya.



kainjow
Nov 29, 2007, 05:07 AM
NSViews are initialized via the initWithFrame: method. They get called awakeFromNib if they are loaded from a nib, but you can't always rely on that, so use initWithFrame.