objective c - Using Value in Whole App and Manupulate That Value -
i want ask question app let me explain you.my app one. ok
i'm giving example. @ first have super value 350 ( value should use 1 time )
when wrote 100 text field , clicked done
remain score 350 - 100 = 250
while not closing app wrote text field again diffirent number 85 , clicked done
remain score 250 - 85 = 165
and third of course not closing app , again wrote text field number 50 , clicked done
remain score 165 - 50 = 115
this continue want create.
in app
İn app going this...
when wrote 100 text field , clicked done
remain score 350 - 100 = 250
while not closing app wrote text field again different number 85 , clicked done
remain score 350 - 85 = 265
and third of course not closing app , again wrote text field number 50 , clicked done
remain score 350 - 50 = 50
this continue this. wrote code.
bascily
int playerscore = [_txt_score.text intvalue]; int gamescore = 501; int currentscore = gamescore - playerscore;
when clicked done button second time processes start on want manipulate gamescore value, not it.
1) create variable value in appdelegate.h file @propertise , @synthesise it
2) set value below: appdelegate *appdelegate = [[uiapplication sharedapplication] delegate]; appdelegate.value -= 5;
Comments
Post a Comment