1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Modifying constant.

Discussion in 'iPhone/iPad Programming' started by julesv, Apr 1, 2009.

  1. macrumors newbie

    I have a simple game based on Image views.
    The difficulty of the game is relative to this constant defined at the beginning of the M file as such:

    #define Difficulty 13

    I would like to change this value using a slider, but I am failing. Please help!
  2. macrumors 601


    Why does it have to be a constant?
  3. macrumors newbie

    I don't know... I'm very new so just tell me what's up in the program that is wrong. I guess I nave to learn via my mistakes. I thought that was a constant....
  4. macrumors 6502a

    Constants, by definition, can't be changed. You want a variable. Try:

    int difficulty = 13;
    You probably want to re-read the basics of Objective-C before continuing.

Share This Page