Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 重新加载数据后未调用cellforrowatindexpath_Ios_Xcode_Uitableview_Swift_Xcode 6.2 - Fatal编程技术网

Ios 重新加载数据后未调用cellforrowatindexpath

Ios 重新加载数据后未调用cellforrowatindexpath,ios,xcode,uitableview,swift,xcode-6.2,Ios,Xcode,Uitableview,Swift,Xcode 6.2,如果我想在TableViewController中获取数据,那么一切都很好,但由于我想将逻辑移到VC外部,当我从VC外部触发重载数据时,它不会调用CellForRowatineXpath,并且我的数据在表中不可见。但是numberOfSectionsInTableView或numberOfRowsInSection被调用,这很有趣。我尝试了很多方法:在主线程上触发重载数据、属性观察器、通知中心,但似乎什么都不起作用,cellForRowAtIndexPath从未被调用。因此,在初始化TableV

如果我想在TableViewController中获取数据,那么一切都很好,但由于我想将逻辑移到VC外部,当我从VC外部触发重载数据时,它不会调用CellForRowatineXpath,并且我的数据在表中不可见。但是numberOfSectionsInTableView或numberOfRowsInSection被调用,这很有趣。我尝试了很多方法:在主线程上触发重载数据、属性观察器、通知中心,但似乎什么都不起作用,cellForRowAtIndexPath从未被调用。

因此,在初始化TableView时,应该添加


tableView.datasource=self

numberOfRowsInSection返回的数字是否大于零?我遵循MVC体系结构,因此我们有一个带有UIBaleViewDataSource和Delegate的单UIView类。数据源和委托已通过NIB映射并在代码中设置。是的,numberOfRowsInSection返回的值大于零@讨厌鬼