Mostrar precio localizado para la compra de la aplicación

Estoy usando el siguiente código en My ViewController, sin embargo cuando llamo _priceFormatter , muestra el precio como (null)

  [buyButton setTitle:[NSString stringWithFormat:@"Upgrade for %@", [_priceFormatter stringFromNumber:product.price]] forState:UIControlStateNormal]; 

ViewController.m

 { NSNumberFormatter * _priceFormatter; } 

ViewDidLoad

  [RageIAPHelper shanetworkingInstance]; _products = nil; [[RageIAPHelper shanetworkingInstance] requestProductsWithCompletionHandler:^(BOOL success, NSArray *products) { if (success) { _products = products; } }]; SKProduct * product = (SKProduct *) [_products objectAtIndex:0]; ([[RageIAPHelper shanetworkingInstance] productPurchased:product.productIdentifier]); _priceFormatter = [[NSNumberFormatter alloc] init]; [_priceFormatter setFormatterBehavior:NSNumberFormatterBehavior10_4]; [_priceFormatter setNumberStyle:NSNumberFormatterCurrencyStyle]; [_priceFormatter setLocale:product.priceLocale]; [_priceFormatter stringFromNumber:product.price]; 

EDITADO

 _priceFormatter = [[NSNumberFormatter alloc] init]; [_priceFormatter setFormatterBehavior:NSNumberFormatterBehavior10_4]; [_priceFormatter setNumberStyle:NSNumberFormatterCurrencyStyle]; [_priceFormatter setLocale:product.priceLocale]; NSString *priceString = [_priceFormatter stringFromNumber:product.price]; 

Botón:

  UIButton *buyButton = [[UIButton alloc] initWithFrame:CGRectMake(-1, 370, 320, 60)]; [buyButton setTitle:[NSString stringWithFormat:@"Upgrade for %@", priceString] forState:UIControlStateNormal]; [buyButton.titleLabel setFont:[UIFont boldSystemFontOfSize:13.0]]; [buyButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [buyButton.titleLabel setShadowColor:[UIColor colorWithWhite:0.1 alpha:1.0]]; [buyButton.titleLabel setShadowOffset:CGSizeMake(0, -1)]; [buyButton addTarget:self action:@selector(buyButtonTapped:) forControlEvents:UIControlEventTouchUpInside]; buyButton.tag = 0; [[self view] addSubview:buyButton]; 

Debe esperar hasta que se llame al manipulador de finalización para procesar los productos:

 [RageIAPHelper shanetworkingInstance]; _products = nil; [[RageIAPHelper shanetworkingInstance] requestProductsWithCompletionHandler:^(BOOL success, NSArray *products) { if (success) { _products = products; SKProduct * product = _products[0]; [[RageIAPHelper shanetworkingInstance] productPurchased:product.productIdentifier]; _priceFormatter = [[NSNumberFormatter alloc] init]; [_priceFormatter setNumberStyle:NSNumberFormatterCurrencyStyle]; [_priceFormatter setLocale:product.priceLocale]; NSString *price = [_priceFormatter stringFromNumber:product.price]; someLabel.text = price; } }]; 

Y como puede ver, debe usar la cadena de numbers formateada. Estabas tirando el valor.