switch (transaction.transactionState) situation SKPaymentTransactionStatePurchasing: // display wait view right here statusLabel.text =


You are watching: Cannot jump from switch statement to this case label

"Processing..."; break; instance SKPaymentTransactionStatePurchased: < finishTransaction:transaction>; // eliminate wait view and also unlock iClooud Syncing statusLabel.text =
"whatever" forServiceName: kStoredData updateExisting:YES error:&error>; // apply purchase activity - hide lock overlay and also ; // do other thing to permit the functions break; situation SKPaymentTransactionStateRestored: < finishTransaction:transaction>; // eliminate wait view right here statusLabel.text =
""; break; situation SKPaymentTransactionStateFailed: if (transaction.error.code != SKErrorPaymentCancelled) NSLog(
"Error payment cancelled"); < finishTransaction:transaction>; // remove wait view below statusLabel.text =
"Purchase Error!"; break; default: break; The last two cases, add to the default, are providing me the complying with error:

Cannot run from switch statement to this situation label

I have actually used the switch statement many, plenty of times; this is the very first time I have actually seen this. The code has actually been replicated from a indict (here), which ns am do the efforts to adapt for my app. Would certainly appreciate the aid on this one. SD


*

C is not Swift. You"ll be happier if you framework your switch statements using curly braces round all of the instances interiors, favor this:

switch (tag) case 1: // curly braces // ... Break; case 2: // curly braces // ... Break; instance 3: // curly braces // ... Break; The extra level of curly braces permits you to perform things girlfriend can"t do otherwise.


*

Not the price you're looking for? Browse other questions tagged objective-c switch-statement ios9 or questioning your own question.


*

site style / logo © 2021 ridge Exchange Inc; user contributions license is granted under cc by-sa. Rev2021.9.17.40238




See more: Get Moving Journey In A Day, Get Moving! Junior Journey Award Set

Stack Overflow works best with JavaScript allowed
*

her privacy

By clicking “Accept every cookies”, girlfriend agree stack Exchange have the right to store cookies on your machine and disclose details in accordance with our Cookie Policy.