iPhone SDK Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsMobile ProgrammingiPhone SDK Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 24th, 2009, 01:39 PM
Wayfarer247 Wayfarer247 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2007
Posts: 33 Wayfarer247 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 11 m 32 sec
Reputation Power: 6
Initialize Variable

This forum seems pretty empty, but thought I'd ask anyways. I just created a view based application, and I want to initialze a varibale upon the application launching.

So:

int r = arc4random() % 74;

The problem is, the number needs to be random every time the app is launched. I was wondering where the proper place to declare such a variable would be.

Thanks!

Reply With Quote
  #2  
Old January 2nd, 2010, 04:58 PM
sneakyimp sneakyimp is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 157 sneakyimp Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 12 h 36 m 30 sec
Reputation Power: 0
Send a message via AIM to sneakyimp
I would say initialize it right before you need it. Is there some problem that you've encountered that prevents this?
__________________
Write multiplayer games with FlashMOG 0.3.1
Try the MyPlan Salary Calculator

Reply With Quote
  #3  
Old January 6th, 2010, 10:40 PM
bilalkhan bilalkhan is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2010
Posts: 1 bilalkhan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 49 sec
Reputation Power: 0
hay

Quote:
Originally Posted by Wayfarer247
This forum seems pretty empty, but thought I'd ask anyways. I just created a view based application, and I want to initialze a varibale upon the application launching.

So:

int r = arc4random() % 74;

The problem is, the number needs to be random every time the app is launched. I was wondering where the proper place to declare such a variable would be.

Thanks!

I want to know that in which programming language you are using this integer function.
tell me the name of the language then it will be easy to get through this problem

cheers

Reply With Quote
Reply

Viewing: Dev Shed ForumsMobile ProgrammingiPhone SDK Development > Initialize Variable

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap