Parse platform pQueryTableView内存
我一直在使用Parse platform pQueryTableView内存,parse-platform,pfquerytableviewcontrolle,Parse Platform,Pfquerytableviewcontrolle,我一直在使用PFQueryTableView处理图像和文本。实施此代码后: - (id)initWithCoder:(NSCoder *)aDecoder { self = [super initWithClassName:@"Story"]; self = [super initWithCoder:aDecoder]; if (self) { // This table displays items in the Todo class self.par
PFQueryTableView
处理图像和文本。实施此代码后:
- (id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithClassName:@"Story"];
self = [super initWithCoder:aDecoder];
if (self) { // This table displays items in the Todo class
self.parseClassName = @"Story";
self.pullToRefreshEnabled = YES;
self.paginationEnabled = YES;
self.objectsPerPage = 25;
}
return self;
}
- (PFQuery *)queryForTable {
PFQuery *query = [PFQuery queryWithClassName:self.parseClassName];
if (self.objects.count == 0) {
query.cachePolicy = kPFCachePolicyCacheThenNetwork;
}
[query orderByDescending:@"createdAt"];
return query;
}
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
object:(PFObject *)object {
static NSString *cellIdentifier = @"cell";
PFTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (!cell) {
cell = [[PFTableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle
reuseIdentifier:cellIdentifier];
}
// Configure the cell to show todo item with a priority at the bottom
cell.textLabel.text = object[@"snapDetails"];
PFFile *thumbnail = [object objectForKey:@"snap"];
cell.imageView.image = [UIImage imageNamed:@"placeholder.jpg"];
cell.imageView.file = thumbnail;
return cell;
}
日志给了我一个奇怪的警告:
[/BuildRoot/Library/Caches/com.apple.xbs/Sources/CoreUI/CoreUI-371.4/Bom/Storage/BOMStorage.c:522]不是BOMStorage文件
还有一个常规内存警告。偶尔该应用程序也会崩溃,
XCode
会显示一条消息,声称它与我的iPhone
失去了连接。检查内存使用情况时,随着表格的上升或下降,内存会继续增加,就好像图像(屏幕大小)在离开屏幕时永远不会释放一样。关于可能发生的事情有什么想法吗?几乎在所有情况下,这都是无害的,除非您的url错误。要使BOMStorage文件更严重,您可以添加以下内容:
urlString = [urlString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
此外,您还可以选择其他替换方法:
[image stretchableImageWithLeftCapWidth:0 topCapHeight:0] forState:UIControlStateNormal]