title: paypal iOS integration
body: <p>I did button and when I pressed it call this method and on iPhone simulator 5 I got error and on iPhone simulator 4.3 work success but after more than one touch on button:  </p>
  
  <pre><code>- (void)simplePayment {
  //dismiss any native keyboards
  
  [PayPal initializeWithAppID:@"APP-80W284485P519543T" forEnvironment:ENV_SANDBOX];
  
  //optional, set shippingEnabled to TRUE if you want to display shipping
  //options to the user, default: TRUE
  [PayPal getPayPalInst].shippingEnabled = TRUE;
  
  //optional, set dynamicAmountUpdateEnabled to TRUE if you want to compute
  //shipping and tax based on the user's address choice, default: FALSE
  [PayPal getPayPalInst].dynamicAmountUpdateEnabled = TRUE;
  
  //optional, choose who pays the fee, default: FEEPAYER_EACHRECEIVER
  [PayPal getPayPalInst].feePayer = FEEPAYER_EACHRECEIVER;
  
  //for a payment with a single recipient, use a PayPalPayment object
  PayPalPayment *payment = [[[PayPalPayment alloc] init] autorelease];
  payment.recipient = @"example-merchant-1@paypal.com";
  payment.paymentCurrency = @"USD";
  payment.description = @"Teddy Bear";
  payment.merchantName = @"Joe's Bear Emporium";
  
  //subtotal of all items, without tax and shipping
  payment.subTotal = [NSDecimalNumber decimalNumberWithString:@"10"];
  
  //invoiceData is a PayPalInvoiceData object which contains tax, shipping, and a list of PayPalInvoiceItem objects
  payment.invoiceData = [[[PayPalInvoiceData alloc] init] autorelease];
  payment.invoiceData.totalShipping = [NSDecimalNumber decimalNumberWithString:@"2"];
  payment.invoiceData.totalTax = [NSDecimalNumber decimalNumberWithString:@"0.35"];
  
  //invoiceItems is a list of PayPalInvoiceItem objects
  //NOTE: sum of totalPrice for all items must equal payment.subTotal
  //NOTE: example only shows a single item, but you can have more than one
  payment.invoiceData.invoiceItems = [NSMutableArray array];
  PayPalInvoiceItem *item = [[[PayPalInvoiceItem alloc] init] autorelease];
  item.totalPrice = payment.subTotal;
  item.name = @"Teddy";
  [payment.invoiceData.invoiceItems addObject:item];
  
  [[PayPal getPayPalInst] checkoutWithPayment:payment];
  </code></pre>
  
  <p>}</p>
  
  <p><strong>Error on iPhone 5 simulator</strong> </p>
  
  <pre><code>&gt; Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSCFConstantString
  &gt; rangeOfString:options:range:locale:]: nil argument'
  &gt; 
  &gt; *** First throw call stack: (0x142df1c 0x15c052e 0x13cfd38 0x13cfcaa 0xd00681 0xd0e35c 0x5400e 0x6a373 0x70958 0x6e823 0x543d9b 0x765be
  &gt; 0x763a1 0x545144 0x5453bb 0x546138 0x4b5b41 0x4bb031 0x4b531f 0x51fb
  &gt; 0x9889 0x54de 0x34df 0x2ff4 0x48084c 0x4807e2 0x52777a 0x527c4a
  &gt; 0x526ee4 0x4a6002 0x4a620a 0x48c60c 0x47fd52 0x1b968f6 0x13fd31a
  &gt; 0x1358d07 0x1356e93 0x1356750 0x1356671 0x1b950c3 0x1b95188 0x47dc29
  &gt; 0x294c 0x2885 0x1) terminate called throwing an exceptionsharedlibrary
  &gt; apply-load-rules all Current language:  auto; currently objective-c
  &gt; (gdb)
  </code></pre>
  
  <p><strong>Should I use paypal button?</strong></p>
  
  <pre><code>UIButton *button = [[PayPal getPayPalInst] getPayButtonWithTarget:self andAction:action andButtonType:type];
  </code></pre>