Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Dec 6, 2009, 10:22 AM   #1
chainprayer
macrumors 6502a
 
Join Date: Feb 2008
Send a message via AIM to chainprayer
Refreshing drill down menu

Please forgive me if my terminology is way off... I'm only a few days into iPhone programming...

I'm working on a program based on the SimpleDrillDown template from Apple. For each screen that is selected I am trying to make random text appear. I am able to get random text to show, but when I go back to the plays screen and select the same category the random integer that is chosen is fixed until I relaunch the app. Can I force the random selection to run again?

I'm using the following code in DataController.m...

Code:
NSString * joke;
srand ( time(NULL) );
	iRandom = rand() % 3 + 1;
	if (iRandom == 1) { textToDisplay = @"one"; }
	if (iRandom == 2) { textToDisplay = @"two"; }
	if (iRandom == 3) { textToDisplay = @"three"; }
Thank you for your help! I'm excited to work in the world of iPhone programming!
__________________
ViralPixel.net
chainprayer is offline   0 Reply With Quote
Old Dec 6, 2009, 12:49 PM   #2
dejo
Moderator
 
dejo's Avatar
 
Join Date: Sep 2004
Location: The Centennial State
In which method does this code reside?
__________________
dejo is offline   0 Reply With Quote
Old Dec 6, 2009, 03:51 PM   #3
chainprayer
Thread Starter
macrumors 6502a
 
Join Date: Feb 2008
Send a message via AIM to chainprayer
The code is in DataController.h under data management
__________________
ViralPixel.net
chainprayer is offline   0 Reply With Quote
Old Dec 6, 2009, 06:57 PM   #4
dejo
Moderator
 
dejo's Avatar
 
Join Date: Sep 2004
Location: The Centennial State
Quote:
Originally Posted by chainprayer View Post
The code is in DataController.h under data management
Doubtful. .h files don't normally contain method execution code, just declarations. Also, you still haven't answered the question: in which method does this code reside?
__________________
dejo is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
ipad: Split View with drill down menu UITableView - Need sample code simonemaynard iPhone/iPad Programming 10 Mar 14, 2011 03:17 PM
How to erase mail address from iPhone mail drill down list MacGiver iPhone Tips, Help and Troubleshooting 2 Jul 22, 2010 07:41 AM
Multi-level drill down using sqlite EdW iPhone/iPad Programming 0 Apr 1, 2009 07:18 PM
Passing Data back through a TableView drill down SuperFreq iPhone/iPad Programming 2 Oct 16, 2008 08:14 AM
<Help> Drilling down to next page. gryym iPhone/iPad Programming 2 Jul 15, 2008 02:03 AM


All times are GMT -5. The time now is 05:22 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC