• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSViewController awakeFromNib and NSTableView numberOfRowsInTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSViewController awakeFromNib and NSTableView numberOfRowsInTableView


  • Subject: Re: NSViewController awakeFromNib and NSTableView numberOfRowsInTableView
  • From: Peter Zegelin <email@hidden>
  • Date: Fri, 26 Jun 2009 12:27:26 +1000


On 26/06/2009, at 11:55 AM, Kyle Sluder wrote:

On Thu, Jun 25, 2009 at 6:33 PM, Peter
Zegelin<email@hidden> 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

Yes, that makes sense - there is an outlet.

At least I know its not my code.

Thanks!

Peter

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


References: 
 >NSViewController awakeFromNib and NSTableView numberOfRowsInTableView (From: Peter Zegelin <email@hidden>)
 >Re: NSViewController awakeFromNib and NSTableView numberOfRowsInTableView (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: GC pros and cons
  • Next by Date: Re: GC pros and cons
  • Previous by thread: Re: NSViewController awakeFromNib and NSTableView numberOfRowsInTableView
  • Next by thread: Substituting characters in a UITextField
  • Index(es):
    • Date
    • Thread