Ios 如何返回零自定义UITableViewCell

Ios 如何返回零自定义UITableViewCell,ios,swift,uitableview,parse-platform,pfquerytableviewcontrolle,Ios,Swift,Uitableview,Parse Platform,Pfquerytableviewcontrolle,在我的cellforrowatinexpath方法中,它从服务器获取数据。如果其中一个数据值为false,我想更改一些全局对象的值并跳过实现此单元格,但当我尝试返回nil时,应用程序崩溃。我正在使用Parse.comPFQueryTableViewController作为UITableViewController,因此按照设置方式,它会获取所有数据,然后通过调用cellforrowatinexpath来处理这些数据。我无法为所述值查询为true的对象,因为当它为false时,我需要更改程序中的其

在我的
cellforrowatinexpath
方法中,它从服务器获取数据。如果其中一个数据值为
false
,我想更改一些全局对象的值并跳过实现此单元格,但当我尝试返回
nil
时,应用程序崩溃。我正在使用Parse.com
PFQueryTableViewController
作为
UITableViewController
,因此按照设置方式,它会获取所有数据,然后通过调用
cellforrowatinexpath
来处理这些数据。我无法为所述值查询为true的对象,因为当它为false时,我需要更改程序中的其他内容

Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView (<UITableView: 0x7e30e400; frame = (0 95; 320 424); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x7b2a94b0>; layer = <CALayer: 0x7b2a8af0>; contentOffset: {0, 0}; contentSize: {320, 1690}>) failed to obtain a cell from its dataSource (<_UIFilteredDataSource: 0x7b26d5a0>)'
-[UITableView\u configureCellForDisplay:forIndexPath:]中的断言失败 ***由于未捕获的异常“NSInternalInconsistencyException”而终止应用程序,原因:“UITableView()未能从其数据源()获取单元格”
您不能为CellForRowatineXpath返回nil,这将使您的应用程序崩溃。 您可以只返回一个单元格,而不返回任何元素,如:
返回[UITableViewCell new]

嗯,在我看来,您最好重新安排您的数据源数组,只需将“true”挑选到一个新数组中即可。使用新阵列将修复您的情况