Can't use reloadData from another class

前端 未结 7 2061
栀梦
栀梦 2021-01-15 03:56

I have 2 classes, classA and classB In classA I have a tableview that works and refreshes on demand. all the delegates and datadource are fine and there\'s also a property <

7条回答
  •  自闭症患者
    2021-01-15 04:26

    Calling the reloadData method refreshes the data as soon as the method is called. Make sure the data source (array or dictionary or wherever you've saved the values) is changed before you call reloadData.

    And you should try reloading the data on the main thread : [tableView performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO];

提交回复
热议问题