Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/288.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Uitableview Xcode应用程序内购买表查看空白_Uitableview_Xcode6_In App Purchase - Fatal编程技术网

Uitableview Xcode应用程序内购买表查看空白

Uitableview Xcode应用程序内购买表查看空白,uitableview,xcode6,in-app-purchase,Uitableview,Xcode6,In App Purchase,因此,我一直在遵循本教程创建应用内购买: 我被困在你在tableView中实际显示应用内购买的部分。我的意思是,首先他忘了包括视图控制器的.h文件。。。所以我不知道里面应该有什么。但我的问题是,tableview加载得很好,但其中没有数据 #import "UpgradeViewController.h" #import "goIAPHelper.h" #import <StoreKit/StoreKit.h> @interface UpgradeViewController (

因此,我一直在遵循本教程创建应用内购买:

我被困在你在tableView中实际显示应用内购买的部分。我的意思是,首先他忘了包括视图控制器的.h文件。。。所以我不知道里面应该有什么。但我的问题是,tableview加载得很好,但其中没有数据

#import "UpgradeViewController.h"
#import "goIAPHelper.h"
#import <StoreKit/StoreKit.h>

@interface UpgradeViewController () {
    NSArray *_products;
}

@end

@implementation UpgradeViewController

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.title = @"In-App Purchases";
    self.tableView.dataSource = self;
    self.tableView.delegate = self;

    self.refreshControl = [[UIRefreshControl alloc] init];
    [self.refreshControl addTarget:self action:@selector(reload) forControlEvents:UIControlEventValueChanged];
    [self reload];
    [self.refreshControl beginRefreshing];


}

// 4
- (void)reload {
    _products = nil;
    [self.tableView reloadData];
    [[goIAPHelper sharedInstance] requestProductsWithCompletionHandler:^(BOOL success, NSArray *products) {
        if (success) {
            _products = products;
            NSLog(@"Products: %@", _products);
            [self.tableView reloadData];
        }
        else{
            NSLog(@"Not Quite");
        }
        [self.refreshControl endRefreshing];
    }];
}

#pragma mark - Table View

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

// 5
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return _products.count;
    NSLog(@"products count: %d", _products.count);
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];

    SKProduct * product = (SKProduct *) _products[indexPath.row];
    cell.textLabel.text = product.localizedTitle;
    NSLog(@"Product Title: %@", product.localizedTitle);

    return cell;
}



@end
因此,它基本上停留在“产品”NSLog上,似乎不再继续

这是我的UpgradeViewController.h文件:

#import <UIKit/UIKit.h>
#import <StoreKit/StoreKit.h>


@interface UpgradeViewController : UITableViewController <UITableViewDelegate, UITableViewDataSource>


@end
#导入
#进口
@界面升级ViewController:UITableViewController
@结束

好的。。。因此,任何遵循该指南(或类似指南)的人都可能会遇到空白表相同的问题。

基本上,由于iTunes没有返回应用程序中的项目,所以表没有填充。。。iTunes没有返回应用程序内的项目,因为你需要填写银行和税务信息

此外,在iAds正常运行之前,你还需要填写所有这些内容(并且已经提交了你的应用程序)。因此,这些是表格将填充的条件

#import <UIKit/UIKit.h>
#import <StoreKit/StoreKit.h>


@interface UpgradeViewController : UITableViewController <UITableViewDelegate, UITableViewDataSource>


@end