OStack程序员社区-中国程序员成长平台

标题: ios - 解析类运行通过 For 循环 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 11:11
标题: ios - 解析类运行通过 For 循环

我的应用使用 Parse.com 提供大部分服务。主屏幕有一个 PFTableViewController,显示某个类的所有对象。我想将所有这些添加为 NSUserActivity,所以我知道我需要通过 for 循环运行它,但是对于我的生活,我想不出如何通过循环运行类以添加每个项目类到 NSUserActivity 中。

摆 table 前我所拥有的。

- (id)initWithCoderNSCoder *)aDecoder
{
    self = [super initWithCoder:aDecoder];
    if (self) {

        // The className to query on
        self.parseClassName = @"rayers";

        // Whether the built-in pull-to-refresh is enabled
        self.pullToRefreshEnabled = YES;

        // Whether the built-in pagination is enabled
        self.paginationEnabled = YES;

        // The number of objects to show per page
        self.objectsPerPage = 20;

    }
    return self;
}
- (PFQuery *)queryForTable {
    NSLog(@"QUERY");
    PFQuery *query = [PFQuery queryWithClassName"rayers"];

    // 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;
}



Best Answer-推荐答案


似乎没有真正的 API...请参阅此链接以了解可能的解决方法:

https://parse.com/questions/all-keys-or-method-or-query-to-determine-common-class-structure-of-all-objects-in-a-class-collection

关于ios - 解析类运行通过 For 循环,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32835274/






欢迎光临 OStack程序员社区-中国程序员成长平台 (https://ostack.cn/) Powered by Discuz! X3.4