【发布时间】:2018-02-13 16:45:46
【问题描述】:
我认为 PFQuery 应该有 1000 个限制,但我遇到了一个问题,它使用以下代码只返回 100 个对象:
- (id)initWithCoder:(NSCoder *)aDecoder
{
NSLog(@"initwithcoder");
self = [super initWithCoder:aDecoder];
if (self) {
NSLog(@"self");
// The className to query on
self.parseClassName = @"Directory";
// Whether the built-in pull-to-refresh is enabled
self.pullToRefreshEnabled = YES;
// Whether the built-in pagination is enabled
self.paginationEnabled = NO;
// The number of objects to show per page
self.objectsPerPage = 0;
}
return self;
}
- (PFQuery *)queryForTable {
NSLog(@"QUERY");
PFQuery *query = [PFQuery queryWithClassName:@"Directory"];
// 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;
}
NSLog(@"Count%lu", self.objects.count);
[query orderByAscending:@"title"];
return query;
}
我尝试过使用“0”以及“500”或“1000”,但没有任何变化。即使将其设置为 2 的低计数仍然返回 100,所以就好像我的应用程序完全忽略了那行代码。
【问题讨论】:
-
把这段代码放在initWithCoder之外
标签: ios parse-platform pfquery