6

I've been working with the PFQueryTableView with images and text. After implementing this code:

-  (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;
}

the log gives me this strange warning:

[/BuildRoot/Library/Caches/com.apple.xbs/Sources/CoreUI/CoreUI-
371.4/Bom/Storage/BOMStorage.c:522] is not a BOMStorage file

along with a regular memory warning. Occasionally the app also crashes and XCode displays a message that claims that it has lost connection to my iPhone. When checking the memory usage, as the table goes up or down the memory continues to increase as if the images (which are screen sized) are never released as they go off screen. Any ideas as to what can be happening?

Cong Tran
  • 1,448
  • 14
  • 30
Matt Sarabyte
  • 245
  • 1
  • 3
  • 10

1 Answers1

0

almost in all cases, this is harmless unless your url is wrong.to make the BOMStorage file more serious, you can add this:

urlString = [urlString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];

Besides,you can choose other method to replace:

[image stretchableImageWithLeftCapWidth:0 topCapHeight:0]  forState:UIControlStateNormal]
Andy
  • 49,085
  • 60
  • 166
  • 233
hpg009
  • 1