首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PFQueryTableView存储器

PFQueryTableView存储器
EN

Stack Overflow用户
提问于 2015-12-29 05:24:21
回答 1查看 433关注 0票数 6

我一直在使用PFQueryTableView的图片和文本。在实现此代码之后:

代码语言:javascript
复制
-  (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的连接。在检查内存使用情况时,随着表的上升或下降,内存将继续增加,就好像图像(屏幕大小)在离开屏幕时从未被释放过一样。对会发生什么有什么想法吗?

EN

回答 1

Stack Overflow用户

发布于 2016-03-19 00:39:37

几乎在所有情况下,这都是无害的,除非您的url是wrong.to,使BOMStorage文件更加严重,您可以添加以下内容:

代码语言:javascript
复制
urlString = [urlString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];

此外,您还可以选择其他方法来替换:

代码语言:javascript
复制
[image stretchableImageWithLeftCapWidth:0 topCapHeight:0]  forState:UIControlStateNormal]
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34504927

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档