Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
好吧,我的问题和这个完全一样:
从不同的控制器调用 UITableView 上的 reloadData
正确答案说我必须将指针返回到我的控制器。我不知道该怎么做。
您可以使用Dependency injection,并从其他控制器注入对您的控制器的引用。
因此,每当您创建其他控制器时,请在其上添加一个 ivar,以便您可以设置对其他控制器的引用。例如:
[myNewController new]; [myNewController setController:oldContorller];