簡體   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