Created
June 28, 2012 10:56
-
-
Save matthiasnagel/3010662 to your computer and use it in GitHub Desktop.
no
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool showAlert = YES; | |
Category *category = [[curArticle articleCategories] anyObject]; | |
if (category.in_app_purchase.length > 0) { | |
if ([category.in_app_purchase isEqualToString:@"frei"]) { | |
category.in_app_purchase = nil; | |
[self doArticle:curArticle]; | |
showAlert = NO; | |
} | |
else { | |
for (SKProduct *product in [WoerterbuchInAppPurchase instance].purchasedProducts) { | |
if ([product.productIdentifier isEqualToString:[NSString stringWithFormat:@"com.mattnail.buchlexikon.%@",category.in_app_purchase]]) { | |
category.purchased = [NSNumber numberWithBool:YES]; | |
[self doArticle:curArticle]; | |
showAlert = NO; | |
break; | |
} | |
} | |
} | |
} | |
else { | |
[self doArticle:curArticle]; | |
showAlert = NO; | |
} | |
if (showAlert) { | |
UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:@"Hinweis" message:[NSString stringWithFormat:@"Bitte kaufen Sie das Paket %@ um diesen Artikel anzusehen",category.title] delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil] autorelease]; | |
[alert show]; | |
} | |
[[DataManager instance] saveContext]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment