myLabel.text = [NSString stringWithFormat:%i, intToPrint];
i will give you any info/pics of my code that you need to be able to help. with that being said it is a NSTimer that i am using for the score
viewController2.score = mainInt1;
Can't you just use the listener observer pattern?
yes Duncan C the score goes up when the timer goes off and yes i have been reading in some beginner books but you said to use viewController2.score = mainInt1; that looks right now would i put that in the .h or .m. where do you think there are some good places to learn properties?
----------
ArtOfWarfare i don't really have a lot of experience and i started with objective-c
The easiest, fastest method is to stick the integer in a C global variable. You can read global variables from anywhere (with an extern declaration).
There are other more robust methodologies for code you plan on maintaining, giving to someone else to maintain, or code that you plan on unit testing or reusing. But very often, that is not the case. Most student apps are thrown away (for good reason). Might as well have another good reason.
Global variables create very tight binding between the different parts of your program. They destroy modularity. The end result is spaghetti-code. Difficult to figure out, difficult to maintain.
Exactly correct. Since student programs are never maintained and smaller than one module of many real apps, there is no reason not to use the simplest coding technique. Globals. No need to make Johnny learn 767 landing procedures at LAX to take the trike for a spin around the backyard.
Save it for apps that need it instead of wasting people's time and battery.
tags. This makes it easier for other to see the code as well as provides an option for them to more-easily copy the code should they want to test something on their own.
If the goal is to learn how to write REAL software...
...i will keep the books in mind i am reading a few right now...