• 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
Re: NSScanner reads the correct number but the number isn't added to an array
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSScanner reads the correct number but the number isn't added to an array


  • Subject: Re: NSScanner reads the correct number but the number isn't added to an array
  • From: j o a r <email@hidden>
  • Date: Sun, 14 Dec 2003 18:53:01 +0100

On 2003-12-14, at 18.21, Philip Riggs wrote:

> NSLog(@"Number %d :: %f", counter, [numberArray
> objectAtIndex:counter]);
<snip>
> Why doesn't numberArray add the correct number?

You're just not printing it correctly. Try:

NSLog(@"Number %d :: %@", counter, [numberArray objectAtIndex:
counter]);

..as you're trying to print the description of the NSNumber instance
in the array, and not it's floating point value.

Alternatively:

NSLog(@"Number %d :: %f", counter, [[numberArray objectAtIndex:
counter] doubleValue]);

j o a r

[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >NSScanner reads the correct number but the number isn't added to an array (From: Philip Riggs <email@hidden>)

  • Prev by Date: Re: NSScanner reads the correct number but the number isn't added to an array
  • Next by Date: NSBox and its contentView
  • Previous by thread: Re: NSScanner reads the correct number but the number isn't added to an array
  • Next by thread: NSBox and its contentView
  • Index(es):
    • Date
    • Thread