Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)viewDidLoad {
- [NSTimer scheduledTimerWithTimeInterval:5.00
- target:self
- selector:@selector(targetMethod)
- userInfo:nil
- repeats:YES];
- NSLog(@"myInt IN VIEW DIDLOAD:::::: %d", myInt);
- }
- - (void)targetMethod {
- iIncValue= iIncValue + 1;
- /*if(a>4)
- {
- a=0;
- }*/
- NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
- [userDefaults setInteger:iIncValue forKey:@"iIncValue"];
- [userDefaults synchronize];
- NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
- myInt = [prefs integerForKey:@"iIncValue"];
- CharsetViewController *oCharsetViewController = [[CharsetViewController alloc] initWithNibName:@"CharsetViewController" bundle:nil];
- oCharsetViewController.myInt = iIncValue;
- NSLog(@"MYINT value in target method ~~~~~~~~~~~ %d", myInt);
- [self presentModalViewController:oCharsetViewController animated:YES];
- [oCharsetViewController release];
- }
- OUTPUT:
- 2012-08-08 14:22:51.268 Charset[2459:207] MYINT value in target method ~~~~~~~~~~~ 1
- 2012-08-08 14:22:51.274 Charset[2459:207] myInt IN VIEW DIDLOAD:::::: 1
- 2012-08-08 14:22:56.267 Charset[2459:207] MYINT value in target method ~~~~~~~~~~~ 2
- 2012-08-08 14:22:56.274 Charset[2459:207] MYINT value in target method ~~~~~~~~~~~ 1
- 2012-08-08 14:22:56.279 Charset[2459:207] myInt IN VIEW DIDLOAD:::::: 1
- 2012-08-08 14:23:01.267 Charset[2459:207] MYINT value in target method ~~~~~~~~~~~ 3
- 2012-08-08 14:23:01.274 Charset[2459:207] MYINT value in target method ~~~~~~~~~~~ 2
- 2012-08-08 14:23:01.279 Charset[2459:207] MYINT value in target method ~~~~~~~~~~~ 1
- 2012-08-08 14:23:01.283 Charset[2459:207] myInt IN VIEW DIDLOAD:::::: 1
- 2012-08-08 14:23:06.267 Charset[2459:207] MYINT value in target method ~~~~~~~~~~~ 4
- 2012-08-08 14:23:06.273 Charset[2459:207] MYINT value in target method ~~~~~~~~~~~ 3
- 2012-08-08 14:23:06.278 Charset[2459:207] MYINT value in target method ~~~~~~~~~~~ 2
- 2012-08-08 14:23:06.283 Charset[2459:207] MYINT value in target method ~~~~~~~~~~~ 1
- 2012-08-08 14:23:06.288 Charset[2459:207] myInt IN VIEW DIDLOAD:::::: 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement