Why am I getting a “Auto Layout still required after executing -layoutSubviews” error every time my app launches now?

前端 未结 9 916
盖世英雄少女心
盖世英雄少女心 2020-12-11 01:11

Since I added the following code, every time my app opens this UITableViewController it crashes:

 self.noArticlesView = [[UIView alloc] init];
          


        
9条回答
  •  猫巷女王i
    2020-12-11 01:30

    for me is was this

    self.tableView.backgroundView = self.emptyView;
    

    I changed to this

        NSComparisonResult order = [[UIDevice currentDevice].systemVersion compare: @"8.0" options: NSNumericSearch];
    if (order == NSOrderedSame || order == NSOrderedDescending) {
        // OS version >= 8.0
        self.tableView.backgroundView = self.emptyView;
    }else{
        [self.tableView.backgroundView addSubview:self.emptyView];
    }
    

提交回复
热议问题