0

Я обновляю свое приложение Parse, переместив все на Heroku, используя серверы Parse с открытым исходным кодом. В моем приложении есть один раздел с PFQueryTableViewController. В течение пары лет у меня была разбита на страницы, так как у нас есть только около 50 предметов, которые будут использоваться в этой таблице. Я запустил его этим утром, а внизу, примерно через 20 пунктов, он остановил опцию Load More. Вот что ... он по-прежнему отключен. Почему это подтягивается?PFQueryTableViewController Игнорирование настройки разбиения на страницы

- (id)initWithCoder:(NSCoder *)aDecoder 
{ 
    self = [super initWithCoder:aDecoder]; 
    if (self) { 

     // The className to query on 
     self.parseClassName = @"FritchDirectory"; 

     // 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:@"FritchDirectory"]; 
    // 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; 
    } 

    [query orderByAscending:@"title"]; 

    return query; 
} 

// Customize the number of sections in the table view. 
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 
    return 1; 
} 


// Customize the number of rows in the table view. 



// Customize the appearance of table view cells. 
- (UITableViewCell *)tableView:(UITableView *)tableView 
     cellForRowAtIndexPath:(NSIndexPath *)indexPath 
         object:(PFObject *)object 
{ 
    static NSString *CellIdentifier = @"Cell"; 

    DirectoryCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 
    if (cell == nil) { 
     [tableView registerNib:[UINib nibWithNibName:@"DirectoryCell" bundle:nil] forCellReuseIdentifier:@"Cell"]; 
     cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"]; 

    } 
    self.theObject = object; 

    RSSEntryDirectory *entry = [_allEntries objectAtIndex:indexPath.row]; 
    cell.theImageView.image = [UIImage imageNamed:@"[email protected]"]; 

    cell.theImageView.contentMode = UIViewContentModeScaleAspectFit; 



    PFFile *thumbnail = object[@"Picture"]; 


    if ([thumbnail isEqual:[NSNull null]]) { 

    } 
    else { 
    [thumbnail getDataInBackgroundWithBlock:^(NSData *imageData, NSError *error) { 

     UIImage *thumbnailImage = [UIImage imageWithData:imageData]; 

     NSLog(@"%@", thumbnail); 
      cell.theImageView.image = thumbnailImage; 
     cell.theImageView.clipsToBounds = YES; 
     NSLog(@"%@", thumbnailImage); 
     //cell.imageView.contentMode = UIViewContentModeScaleAspectFit; 
    }]; 
    } 





    cell.names.text = object[@"title"]; 
    NSLog(@"NAMES%@", object[@"title"]); 
    CALayer * l = [cell.theImageView layer]; 
    [l setMasksToBounds:YES]; 
    [l setCornerRadius:11]; 
    [l setBorderWidth:2.0]; 
    [l setBorderColor:[[UIColor blackColor] CGColor]]; 
    if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) 
    { 
     UIFont *cellFont = [UIFont fontWithName:@"ArialRoundedMTBold" size:38]; 
     cell.names.font = cellFont; 
     UIFont *cellFont2 = [UIFont fontWithName:@"ArialRoundedMTBold" size:24]; 
     cell.detailTextLabel.font = cellFont2; 
    } 
    else { 
     UIFont *cellFont = [UIFont fontWithName:@"ArialRoundedMTBold" size:20]; 
     cell.names.font = cellFont; 
     UIFont *cellFont2 = [UIFont fontWithName:@"ArialRoundedMTBold" size:12]; 
     cell.detailTextLabel.font = cellFont2; 
    } 


    return cell; 
} 
+0

Какую версию пользовательского интерфейса для синтаксического анализа вы используете? – Cliffordwh

+0

Я не уверен. Дело в том, что я сделал НИЧЕГО для файла реализации для этого приложения, и он все еще показывает все записи в существующей версии, но это загружает проблемы с разбивкой по страницам. Единственное, что я сделал на всех, которые МОГУТ повлиять на это, - это изменить приложение из приложения на основе табуляции на один контроллер навигации. Это повлияет на это? @Cliffordwh – user717452

+0

Даже комментируя строку 'self.paginationEnabled' и устанавливая 1000 объектов на страницу, это вообще не изменяет поведение. – user717452

ответ

1

Просто, чтобы быть чистым. PFQueryTableViewController работает некорректно при размещении в NavigationViewController. Убедитесь, что он находится в ваших TableViewController, TabViewController или ViewController.

Смежные вопросы