Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

azg442

macrumors newbie
Original poster
May 10, 2009
12
0
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!
 
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.
 
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.