[错误]:类名中的错误字符 - PFQueryTableViewController

[Error]: bad characters in classname - PFQueryTableViewController

您好,我一直在尝试测试 Parse PFQueryTableViewController 的功能...但是不断收到以下错误:

[错误]:class名称中的错误字符:(空)(代码:103,版本:1.8.0)

我正在使用 Parse 网站的标准代码来执行此操作并尝试从我的 Pase class 加载 tableviewcontroller: 即:

- (instancetype)initWithStyle:(UITableViewStyle)style {
    self = [super initWithStyle:style];
    if (self) { // This table displays items in the Todo class
        self.parseClassName = @"Categories";
        self.pullToRefreshEnabled = YES;
        self.paginationEnabled = YES;
        self.objectsPerPage = 25;
    }
    return self;
}

- (PFQuery *)queryForTable {
    PFQuery *query = [PFQuery queryWithClassName:self.parseClassName];

    // If no objects are loaded in memory, we look to the cache first to fill the table
    // and then subsequently do a query against the network.
//    if (self.objects.count == 0) {
//        query.cachePolicy = kPFCachePolicyCacheThenNetwork;
//    }

    [query orderByDescending:@"createdAt"];

    return query;
}



- (UITableViewCell *)tableView:(UITableView *)tableView
         cellForRowAtIndexPath:(NSIndexPath *)indexPath
                        object:(PFObject *)object {
    static NSString *cellIdentifier = @"categoryCell";

    PFTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
    if (!cell) {
        cell = [[PFTableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle
                                      reuseIdentifier:cellIdentifier];}

    // Configure the cell to show todo item with a priority at the bottom

    cell.textLabel.text = object[@"Category"];
    cell.detailTextLabel.text = object[@"Sequence"];

    return cell;
}

如有任何帮助,我们将不胜感激,谢谢。

使用界面生成器创建解析提供的 vc 时出现问题:IB 视图控制器使用 initWithCoder: 初始化,而不是 initWithStyle

涵盖任何一种初始化程序的一种方法是分解自定义代码并实现两者,如下所示:

- (void)customInit {
    self.parseClassName = @"Categories";
    self.pullToRefreshEnabled = YES;
    self.paginationEnabled = YES;
    self.objectsPerPage = 25;
}

- (id)initWithStyle:(UITableViewStyle)style {
    self = [super initWithStyle:style];
    if (self) {
        [self customInit];
    }
    return self;
}

- (id)initWithCoder:(NSCoder *)aDecoder {
    self = [super initWithCoder:aDecoder];
    if (self) {
        [self customInit];
    }
    return self;
}