6
私は画像とテキストでPFQueryTableView
を使用しています。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/BomStorage.c:522]はBOMStorageファイルではありません
と通常のメモリ警告があります。アプリがクラッシュすることがあり、XCode
は、iPhone
への接続が失われたと主張するメッセージを表示します。メモリ使用量をチェックすると、テーブルが上下に動くにつれて、画面サイズの画像がスクリーンから出るときに解放されないかのようにメモリが増加し続けます。何が起こっている可能性についての任意のアイデア?あなたのURLがBOMStorageファイルより深刻にするwrong.toある場合を除き、ほぼすべてのケースで