Re: Can -[NSTableColumn width] return Not a Number (nan)?
Re: Can -[NSTableColumn width] return Not a Number (nan)?
- Subject: Re: Can -[NSTableColumn width] return Not a Number (nan)?
- From: Graham Cox <email@hidden>
- Date: Thu, 24 Dec 2009 15:12:33 +1100
On 24/12/2009, at 2:58 PM, Jerry Krinock wrote:
> I just spent many hours tracking down a problem that turned out to be that a column width had been written to my app's user defaults as Not a Number (nan). The only line of code that writes this pref assigns it directly from -[NSTableColumn width]. I don't see any indication in the documentation that this method can return nan. Has anyone ever seen -[NSTableColumn width] return nan?
I couldn't swear to it, but it could have happened because the width ended up at zero, then something else performed a div-by-zero using that width, and inserted an inf or NaN.
I've definitely seen some funny effects if resizing allows certain views, tables among them, to end up with zero widths - re-enlarging rarely works afterwords because in going to zero information about proportions, etc was lost. It's worth checking that no column can go to zero when a window is sized very small - set minimum limits on the window and views as needed to ensure it can't happen.
--Graham
_______________________________________________
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