Re: NaN Problem Adding Numbers from NSTableView
Re: NaN Problem Adding Numbers from NSTableView
- Subject: Re: NaN Problem Adding Numbers from NSTableView
- From: Keary Suska <email@hidden>
- Date: Thu, 22 Apr 2010 08:47:21 -0600
On Apr 21, 2010, at 7:24 PM, Graham Cox wrote:
>
> On 22/04/2010, at 12:53 AM, Philip Juel Borges wrote:
>
>> But some times I need to leave a tableview cell blank and then it writes NaN in the label. If I type in 0 (zero) it adds up the numbers nicely. But I'd rather just leave the selection empty rather than typing in a zero.
>>
>> Any ideas how to solve the NaN issue?
>
>
> Add a formatter to the cell and set the 'NaN symbol' to 0. You can do this in IB.
I wouldn't think that the formatter would effect the calculation of a key path operator, which is the OP's main issue as I understand--@sum is choking on NaN...
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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