Refreshing drill down menu

Discussion in 'iPhone/iPad Programming' started by chainprayer, Dec 6, 2009.

  1. macrumors 6502a

    chainprayer

    Joined:
    Feb 10, 2008
    #1
    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!
     
  2. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    In which method does this code reside?
     
  3. thread starter macrumors 6502a

    chainprayer

    Joined:
    Feb 10, 2008
    #3
    The code is in DataController.h under data management
     
  4. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #4
    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?
     

Share This Page