I am creating an iphone app in which i have some vale in integer in my oneviewcontroller and i want that integer value in my secondviewcontroller controller.
value will be random. I stored this integer value in id score
Nw I am using this code but,i cant get integer value.
CODE : passing integer value from one UIView to another UIview
Integer Value always becomes zero at the secondviewcontroller.
Any Help will be appreciated.
Thanks.
MY CODE:
FirstView.h file
NSInteger myScore;
id score;
NSInteger totalscore;
.m file
NSInteger *cal = (myScore * 100)/400 ;
totalscore = cal;
score = totalscore;
SecondView.h file
int scorevalue ;
SecondView.m file
FirstViewController *firstVC = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil];
value = firstVC.Score;
NSLog(@"SCORE : %d" ,value );