我正在创建一个iphone应用程序,其中我的oneviewcontroller中有一些整数值,我希望在我的secondviewcontroller控制器中使用整数值。想要将整数值传递到另一个视图
值将是随机的。 我存储这个整数值在id分数
Nw我正在使用此代码,但我无法获得整数值。
CODE:passing integer value from one UIView to another UIview
整数值总是在secondviewcontroller变为零。
任何帮助将不胜感激。
谢谢。
我的代码:
FirstView.h文件
NSInteger myScore;
id score;
NSInteger totalscore;
.m文件
NSInteger *cal = (myScore * 100)/400 ;
totalscore = cal;
score = totalscore;
SecondView.h文件
int scorevalue ;
SecondView.m文件
FirstViewController *firstVC = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil];
value = firstVC.Score;
NSLog(@"SCORE : %d" ,value);
你能显示你的代码吗? – Sascha
@Sascha:我编辑了我的代码..请看看.. – iUser
@Shrey:好的..我试过这个,但我想在SecondView ..中的值,并在第二次查看值变成0(零)..任何帮助。 !!:o – iUser