We have a big issue with the current Xcode version (10.2).
There is a BasicViewController
class with the following signature:
class BasicViewController: UIViewController, UITableViewDataSource, UITableViewDelegate
Then we have another class like ExampleViewController: BasicViewController
which has some additional logic.
Now comes the tricky part...
We build and run the app on different simulators and devices and everything works properly. Then we archive the app and suddenly didSelectRow
is not fired anymore. Deep clean and clean of the project allowed us to reproduce the issue without the need to archive again.
I cannot think of any case when this could happen. And it gets even worse, because I found more similar issues with UITableViewDelegate
methods not being called in the child class only when running the archived app. Could it be an issue with some of the optimisations during archiving and submitting the app?
I verify that we set the dataSource
and delegate
of the table properly, there are no gesture recognisers over the table. The same logic works well after running the app second/third time, but fails first time after a deep clean of the project.
We made a test and set the UITableViewDataSource
and UITableViewDelegate
in the child class and then it works as expected every time. It seems inheriting the protocols does not work well. If we keep the protocols in the parent and also add them in the child class, then it says that the protocols in the child class are redundant.
Has anyone experienced anything similar? Any suggestions are welcome.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…