Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView "sometimes" doesn't repaint on reloadData:?




On Aug 30, 2008, at 4:42 PM, marc hoffman wrote:

Andrew, Michael,

So then the question is, why does this -reloadData call fail? The most
obvious reason would be that its target is nil. In any case, step
through the code in question in the debugger, and hopefully the reason
shall be revealed.

i got it: the problem was actually my tableViewSelectionDidChange: handler. it did not appreciate me having a selection at a higher index then the new row count. tableViewSelectionDidChange: was triggered with -1 from within reloadData (makes sense), failed with an exception, and apparently that prevented reloadData from finishing properly. it also explains why the problem seemed so intermittent.


as most bugs, a real "duh" moment, once figured out ;).

thanx for bearing with me,
marc

Glad to hear that the problem's source was revealed! If you haven't already, I'd suggest that you set a breakpoint on objc_exception_throw (and -[NSException raise] if you're running before Leopard), such that the program will stop on exceptions and bring you (hopefully) to the exact line of code, in the debugger, that caused the exception. Doing so has helped me countless times with my own programs. :)


Cheers,
	Andrew

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >NSTableView "sometimes" doesn't repaint on reloadData:? (From: marc hoffman <email@hidden>)
 >Re: NSTableView "sometimes" doesn't repaint on reloadData:? (From: "Michael Ash" <email@hidden>)
 >Re: NSTableView "sometimes" doesn't repaint on reloadData:? (From: marc hoffman <email@hidden>)
 >Re: NSTableView "sometimes" doesn't repaint on reloadData:? (From: marc hoffman <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.