Professional Web Applications Themes

Obtaining a long long value from an NSTextField - Mac Programming

I'm reading a number from an NSTextField that could be bigger than 2^32. NSTextField has methods to return intValue, floatValue, and doubleValue, but not longLongValue. I know that I can move it into an NSString, then convert substrings to intValues and work out the long long by multiplying. Before I do that, though, I wonder if anyone has a better idea. I'm still on 10.2, if it matters. Thanks,...

  1. #1

    Default Obtaining a long long value from an NSTextField


    I'm reading a number from an NSTextField that could be bigger than
    2^32. NSTextField has methods to return intValue, floatValue, and
    doubleValue, but not longLongValue.

    I know that I can move it into an NSString, then convert substrings to
    intValues and work out the long long by multiplying. Before I do that,
    though, I wonder if anyone has a better idea.

    I'm still on 10.2, if it matters.

    Thanks,
    Steve Guest

  2. #2

    Default Re: Obtaining a long long value from an NSTextField

    Steve Ketcham <nospam.net> wrote:
     

    [NSScanner scanLongLong:]. m.


    --
    matt neuburg, phd = com, http://www.tidbits.com/matt/
    Read TidBITS! It's free and smart. http://www.tidbits.com
    matt Guest

  3. #3

    Default Re: Obtaining a long long value from an NSTextField

    In article <1g5ntbk.1rkw6a01ejzi0wN%com>,
    com (matt neuburg) wrote:
     

    Another possibility is to convert it to an NSDecimalNumber via
    +decimalNumberWithString:, which gets you -longLongValue, or conversion
    to a number (pun!) of other base type values.
    Doc Guest

Similar Threads

  1. Question about a long session timeout (somewhat long)
    By Stupid48 in forum ASP.NET Security
    Replies: 7
    Last Post: March 1st, 10:04 PM
  2. strtotime and dates long long ago ...
    By ruud in forum PHP Development
    Replies: 2
    Last Post: December 29th, 05:48 AM
  3. IDS 7.3* - Long long long checkpoint !
    By Laurent in forum Informix
    Replies: 1
    Last Post: October 28th, 09:18 PM
  4. Can not use 'CDO' any long?
    By jeff in forum ASP.NET General
    Replies: 3
    Last Post: July 29th, 03:18 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139