A UIButton
with title ---> Free Coins - Press <----
on viewControllerA
is pressed.
viewControllerA
:
- (IBAction)triggerVideo
{
[AdColony playVideoAdForZone:@"HIDDEN-CODE-PRIVACY" withDelegate:nil
withV4VCPrePopup:YES andV4VCPostPopup:YES];
}
50 coins are gained when it's clicked:
// Get currency balance from persistent storage and display it
- (void)updateCurrencyBalance
{
NSNumber* wrappedBalance = [[NSUserDefaults standardUserDefaults]
objectForKey:kCurrencyBalance];
NSUInteger balance = wrappedBalance && [wrappedBalance isKindOfClass:
[NSNumber class]] ? [wrappedBalance unsignedIntValue] : 0;
[currencyLabel setText:[NSString stringWithFormat:@"%u", balance]];
}
But these coins must only show up on viewControllerB
, on the label called lblpts
. Or at least show up on both as the same values!
I've tried to use ints: e.g. int point
, and objectForKey:@"point"
, e.g.:
savedStock = [[NSMutableDictionary alloc] initWithContentsOfFile: path];
nPoint = [[savedStock objectForKey:@"point"] intValue];
[_lblpts setText:[NSString stringWithFormat:@"%d",nPoint]];
But it seems, I can't make the balance appear only on the viewControllerB
label!