Passing data between two views??

Discussion in 'iOS Programming' started by azg442, May 10, 2009.

  1. azg442 macrumors newbie

    Joined:
    May 10, 2009
    #1
    I'm really frustrated because its been hours and I cannot get this to work. In one view I have a NSInteger called scoreValue. I would like to be able to access scoreValue in another view. For example lets say the user gets 10 points (scoreValue), in a different view it would say "You scored 10 points!".

    Thanks in advance!
     
  2. BlackWolf macrumors regular

    Joined:
    Apr 9, 2009
    #2
    I think the easiest way to archieve this would be to pass View 1 (the one with the integer) as a method-parameter to View 2. This way, View 2 could access the int via View 1.
     
  3. firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #3
    If you have a small simple application, and don't plan to scale it to 100X more complicated, just stick the data you want passed in a global variable. Use plain old C. Read and write (and/or corrupt) the global data from anywhere.
     

Share This Page