ios – 收到以下错误“此查询具有出色的网络连接.你必须等到它完成.“

ios – 收到以下错误“此查询具有出色的网络连接.你必须等到它完成.“,第1张

概述我不明白为什么我得到 ‘此查询具有出色的网络连接.你必须等到它完成. 因为我只运行一个查询任何人都可以在这里帮忙,因为我是新手解析 - (id)initWithCoder:(NSCoder *)aCoder { self = [super initWithCoder:aCoder]; if (self) { // Customize the table 我不明白为什么我得到
‘此查询具有出色的网络连接.你必须等到它完成.

因为我只运行一个查询任何人都可以在这里帮忙,因为我是新手解析

- (ID)initWithCoder:(NSCoder *)aCoder {    self = [super initWithCoder:aCoder];    if (self) {        // Customize the table        // The classname to query on        self.parseClassname = @"Exibitor";        // The key of the PFObject to display in the label of the default cell style        self.textKey = @"name";        // Uncomment the following line to specify the key of a PFfile on the PFObject to   display in the imageVIEw of the default cell style        // self.imageKey = @"image";        // Whether the built-in pull-to-refresh is enabled        self.pullToRefreshEnabled = YES;        // Whether the built-in pagination is enabled        self.paginationEnabled = YES;        // The number of objects to show per page        self.objectsPerPage = 25;     }     return self;    }    #pragma mark - VIEw lifecycle    - (voID)vIEwDIDLoad    {    [super vIEwDIDLoad];    // Uncomment the following line to preserve selection between presentations.    //self.cleaRSSelectionOnVIEwWillAppear = NO;    // Uncomment the following line to display an Edit button in the navigation bar for this   vIEw controller.    // self.navigationItem.rightbarbuttonItem = self.editbuttonItem;    }    - (voID)vIEwDIDUnload    {    [super vIEwDIDUnload];    // Release any retained subvIEws of the main vIEw.    // e.g. self.myOutlet = nil;    }    - (voID)vIEwWillAppear:(BOol)animated    {    [super vIEwWillAppear:animated];    }    - (voID)vIEwDIDAppear:(BOol)animated    {    [super vIEwDIDAppear:animated];    [super vIEwDIDAppear:animated];    self.candisplayBannerAds = YES;    }    - (voID)vIEwWilldisappear:(BOol)animated    {    [super vIEwWilldisappear:animated];    }    - (voID)vIEwDIDdisappear:(BOol)animated    {    [super vIEwDIDdisappear:animated];    }    - (BOol)shouldautorotatetoInterfaceOrIEntation:  (UIInterfaceOrIEntation)interfaceOrIEntation    {    // Return YES for supported orIEntations    return (interfaceOrIEntation == UIInterfaceOrIEntationPortrait);    }    - (voID)dIDReceiveMemoryWarning    {    // Releases the vIEw if it doesn't have a supervIEw.    [super dIDReceiveMemoryWarning];    // Release any cached data,images,etc that aren't in use.    }    #pragma mark - Parse    - (voID)objectsDIDLoad:(NSError *)error {    [super objectsDIDLoad:error];    // This method is called every time objects are loaded from Parse via the PFquery    }    - (voID)objectsWillLoad {    [super objectsWillLoad];    // This method is called before a PFquery is fired to get more objects    }    // OverrIDe to customize what kind of query to perform on the class. The default is to query for     // all objects ordered by createdAt descending.     - (PFquery *)queryFortable {    PFquery *query = [PFquery queryWithClassname:@"Exibitor"];    [query whereKey:@"Trade" equalTo:@"true"];    [query getFirstObjectInBackgrounDWithBlock:^(PFObject *object,NSError *error) {        if (!object) {            NSLog(@"The getFirstObject request Failed.");        } else {            // The find succeeded.            NSLog(@"Successfully retrIEved the object.");        }    }];    return query;    }    // OverrIDe to customize the look of a cell representing an object. The default is to display     // a UItableVIEwCellStyleDefault style cell with the label being the first key in the object.    - (UItableVIEwCell *)tableVIEw:(UItableVIEw *)tableVIEw cellForRowAtIndexPath:(NSIndexPath    *)indexPath object:(PFObject *)object {    static Nsstring *CellIDentifIEr = @"Cell";    UItableVIEwCell *cell = [tableVIEw dequeueReusableCellWithIDentifIEr:CellIDentifIEr];    if (cell == nil) {        cell = [[UItableVIEwCell alloc] initWithStyle:UItableVIEwCellStyleSubTitle  reuseIDentifIEr:CellIDentifIEr];    }    // Configure the cell    cell.textLabel.text = [object objectForKey:@"text"];    cell.detailTextLabel.text = [Nsstring stringWithFormat:@"name: %@",[object  objectForKey:@"name"]];    return cell;     }     /*    // OverrIDe if you need to change the ordering of objects in the table.    - (PFObject *)objectAtIndex:(NSIndexPath *)indexPath {    return [objects objectAtIndex:indexPath.row];     }     */    /*     // OverrIDe to customize the look of the cell that allows the user to load the next page     of objects.     // The default implementation is a UItableVIEwCellStyleDefault cell with simple labels.     - (UItableVIEwCell *)tableVIEw:(UItableVIEw *)tableVIEw cellForNextPageAtIndexPath:       (NSIndexPath *)indexPath {     static Nsstring *CellIDentifIEr = @"NextPage";    UItableVIEwCell *cell = [tableVIEw dequeueReusableCellWithIDentifIEr:CellIDentifIEr];     if (cell == nil) {     cell = [[UItableVIEwCell alloc] initWithStyle:UItableVIEwCellStyleDefault       reuseIDentifIEr:CellIDentifIEr];     }      cell.selectionStyle = UItableVIEwCellSelectionStyleNone;     cell.textLabel.text = @"Load more...";     return cell;     }   */    #pragma mark - table vIEw data source    /*     // OverrIDe to support conditional editing of the table vIEw.     - (BOol)tableVIEw:(UItableVIEw *)tableVIEw canEditRowAtIndexPath:(NSIndexPath *)indexPath     {     // Return NO if you do not want the specifIEd item to be editable.     return YES;     }     */     /*     // OverrIDe to support editing the table vIEw.      - (voID)tableVIEw:(UItableVIEw *)tableVIEw commitEditingStyle:   (UItableVIEwCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {      if (editingStyle == UItableVIEwCellEditingStyleDelete) {     // Delete the row from the data source     [tableVIEw deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]    withRowAnimation:UItableVIEwRowAnimationFade];     }     else if (editingStyle == UItableVIEwCellEditingStyleInsert) {     // Create a new instance of the appropriate class,insert it into the array,and add a new    row to the table vIEw     }     }     */   /*     // OverrIDe to support rearranging the table vIEw.     - (voID)tableVIEw:(UItableVIEw *)tableVIEw moveRowAtIndexPath:(NSIndexPath *)fromIndexPath   toIndexPath:(NSIndexPath *)toIndexPath     {     }     */    /*     // OverrIDe to support conditional rearranging of the table vIEw.     - (BOol)tableVIEw:(UItableVIEw *)tableVIEw canMoveRowAtIndexPath:(NSIndexPath *)indexPath     {      // Return NO if you do not want the item to be re-orderable.     return YES;     }     */    #pragma mark - table vIEw delegate     - (voID)tableVIEw:(UItableVIEw *)tableVIEw dIDSelectRowAtIndexPath:(NSIndexPath   *)indexPath     {    [super tableVIEw:tableVIEw dIDSelectRowAtIndexPath:indexPath];     }    @end

任何人都可以帮助解决这个问题,我是新来解析的,我已经完成了,因为它告诉我在文档中

解决方法 在queryFortable方法中,您不应该执行查询,只能配置并返回它.

- (PFquery *)queryFortable {  PFquery *query = [PFquery queryWithClassname:@"Exibitor"];  [query whereKey:@"Trade" equalTo:@"true"];  return query;}

您正在执行查询,这将导致您遇到的行为,因为表控制器也尝试执行它.

总结

以上是内存溢出为你收集整理的ios – 收到以下错误“此查询具有出色的网络连接.你必须等到它完成.“全部内容,希望文章能够帮你解决ios – 收到以下错误“此查询具有出色的网络连接.你必须等到它完成.“所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1023854.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存