On Thu, Jun 25, 2009 at 6:33 PM, Peter
Zegelin<pe...@fracturedsoftware.com> wrote:
> Unfortunately my numberOfRowsInTableView is being called 'before'
> awakeFromNib, so initially numColumns = 0 and I get an error
> (myDataSize/numColumns will be infinite).

So set a flag in -awakeFromNib.  Check this flag in
-numberOfRowsInTableView: and return 0 if this flag isn't set.

> I always thought awakeFromNib would get called first. But in this case not
> so. So can anyone suggest why, and a workaround?

The order of -awakeFromNib calls is not guaranteed.  In fact, you
probably have an outlet from your tree controller to your table view,
so the table view must necessarily be awoken first, since all outlets
are guaranteed to be set up before -awakeFromNib is called.
NSTableView's -awakeFromNib probably causes it to probe its delegate.

--Kyle Sluder
_______________________________________________

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