通过For循环解析Class运行
Parse Class Run Through For Loop
我的应用使用 Parse.com 来提供大部分服务。主屏有一个PFTableViewController,显示某class的所有对象。我想将所有这些添加为 NSUserActivity,所以我知道我需要通过 for 循环 运行 它,但是对于我来说,想不出如何 运行 class 通过循环将 class 中的每个项目添加到 NSUserActivity.
设置 table.
之前我已经知道了什么
- (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...请参考此 link 以获得可能的解决方法:
我的应用使用 Parse.com 来提供大部分服务。主屏有一个PFTableViewController,显示某class的所有对象。我想将所有这些添加为 NSUserActivity,所以我知道我需要通过 for 循环 运行 它,但是对于我来说,想不出如何 运行 class 通过循环将 class 中的每个项目添加到 NSUserActivity.
设置 table.
之前我已经知道了什么- (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...请参考此 link 以获得可能的解决方法: