oneviewcontroller に整数値が含まれている iphone アプリを作成していますが、secondviewcontroller コントローラーにその整数値が必要です。
値はランダムになります。この整数値をidスコアに保存しました
このコードを使用していますが、整数値を取得できません。
CODE :ある UIView から別の UIview に整数値を渡す
整数値は、2 番目のビュー コントローラーで常にゼロになります。
どんな助けでも大歓迎です。
ありがとう。
私のコード:
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 );