繁体   English   中英

解析类贯穿 For 循环

[英]Parse Class Run Through For Loop

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

到目前为止,我在设置桌子之前所拥有的东西。

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

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

        // 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:@"Prayers"];

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

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM