Thanks Nick,
I moved all of my tableview population code to AwakeFromNib and it is all working fine. Thanks so much.

Regards
Damien

On 16/02/2009, at 1:18 PM, Nick Zitzmann wrote:


On Feb 15, 2009, at 2:27 PM, Damien Cooke wrote:

This does not work and I was wondering if
1: can I programatically select an item in a NSTableView?

Well, what you're doing is technically correct, although I'd recommend using NSUInteger instead of unsigned, but that's not the problem...

2: have I done something stupid?
3: This is part of the init of the NSPanel subclass should it be somewhere else (awakeFromNib does not work either).


Yes. What you are trying to do breaks MVC separation. If you need to pass select messages to a table view, then you should do that from an NSWindowController subclass, not an NSPanel subclass.

In addition, IBOutlets aren't available at initialization time; they are only available once the nib has been loaded and instantiated.

Nick Zitzmann
<http://www.chronosnet.com/>




"We act as though comfort and luxury were the chief requirements of life, when all that we need to make us happy is something to be enthusiastic about."

-- Albert Einstein




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to