• 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
how to get a double from an NSString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how to get a double from an NSString


  • Subject: how to get a double from an NSString
  • From: Bob Sabiston <email@hidden>
  • Date: Mon, 26 May 2008 14:13:49 -0500

Hello,

I'm trying to get an NSTableView to be editable, and I am having trouble getting a numerical value from the supplied object. The setObjectValue method (?) supplies an argument called aData for the specific row and column. That aData is an NSObject, and an NSString I think. How do I convert that to a double floating point number? I need to set a value in an array that is being passed from a Carbon app.

I've tried

double val = [aData doubleValue];

but that doesn't work. I have little experience with Cocoa and I wrote this code years ago.

Thanks for any help,
Bob


- (void)tableView:(NSTableView *)aTableView setObjectValue:(id)aData forTableColumn:(NSTableColumn *)aCol row:(int)rowIndex { double val = [aData doubleValue];





_______________________________________________

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


  • Follow-Ups:
    • Re: how to get a double from an NSString
      • From: Chris Hanson <email@hidden>
    • Re: how to get a double from an NSString
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Re: assignment in if clause
  • Next by Date: Re: NSFileManager's errors in 10.5, where are they documented?
  • Previous by thread: Re: Just a simple general question...
  • Next by thread: Re: how to get a double from an NSString
  • Index(es):
    • Date
    • Thread