Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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];
Add Comment
Please, Sign In to add comment