• 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: Random numbers?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Random numbers?


  • Subject: Re: Random numbers?
  • From: Manfred Schwind <email@hidden>
  • Date: Thu, 5 Jul 2007 15:55:02 +0200

What's the proper way to get a random number in ObjC/Cocoa? I need it in an NSNumber to put in an NSArray. Thanks.

Besides the already mentioned ways you could also read bytes out of / dev/random and then put it into an NSNumber.


man 4 random

The random device produces uniformly distributed random byte values of potentially high quality [...]

Regards,
Mani
--
http://www.mani.de
iVolume - Loudness adjustment for iTunes.
LittleSecrets - The encrypted notepad.


_______________________________________________

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


References: 
 >Random numbers? (From: William Squires <email@hidden>)

  • Prev by Date: Adding metadata to images
  • Next by Date: Re: How to support an Application with International languages.
  • Previous by thread: Re: Random numbers?
  • Next by thread: Re: Random numbers?
  • Index(es):
    • Date
    • Thread