View Full Version : Passing data between two views??
azg442
May 10, 2009, 10:09 PM
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!
BlackWolf
May 11, 2009, 07:07 AM
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.
firewood
May 11, 2009, 01:10 PM
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.
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.