Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 08-27-2008, 09:18 PM   #1 (permalink)
spuy767
New Member
 
Join Date: Aug 2008
Posts: 100
spuy767 is on a distinguished road
Angry Why are random numbers so freaking difficult?

Why in the hell can't the random number function in XCode work like every other random number function I've used?

I'm writing a game. I need to calculate random numbers every millisecond to calculate deviations from a predefined path. When I used every random number function in the cocoa library, i always get the same numbers no matter when or how I run the app. I've tried making my own random numbers by manipulating the various NSCalendarDate references. I've tried to seed srand() and srandom()with the date, but I always get a improper use of void something or other error. It's really starting to make me angry that I can write complex graphical apps and animations with no problem but a random number generator effectively kicks my butt. Maybe I'm missing something extremely simple.
spuy767 is offline   Reply With Quote
 

» Advertisements
» Online Users: 480
18 members and 462 guests
ArthurOff, Arty Tales, baja_yu, Bertrand21, bignoggins, dbramhall, djohnson, fanarin, Feldspar, habitatus, lgehrig1, LooN3y, myach, Nobbsy, pbart, skog, Thompson22, Warblr
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,427
Threads: 94,024
Posts: 402,576
Top Poster: BrianSlick (7,978)
Welcome to our newest member, shakiraeb60
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:07 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.