从 NSObject 中的 didSelectRowAtIndexPath 调用 UIViewController 中的方法

Call method in UIViewController from didSelectRowAtIndexPath in NSObject

我有一个 UIViewController(A),它使用带有委托方法的 NSObject 以编程方式显示 UITableView。这很好用。

但是当我 select 一行时,我想加载一个不同的 UIViewController(B)。我尝试在 didSelectRowAtIndexPath 中调用的 UIViewController(A) 上使用 NSNotification。然而,这需要大约 20 秒来加载 UIViewController(B)。

注意:我知道 UIViewController(B) 在加载方面没有任何问题。

我检查过UIViewController(B) 的显示是在主线程上。它是什么。

因此,我认为可能有一种替代方法来显示 UIViewController(B)。我正在考虑的替代方法是在 UIViewController(A) 中编写一个方法来呈现 UIViewController(B)。但是我如何从 NSObject didSelectRowAtIndexPath 方法中调用它。

设法让它工作。所以对于任何遇到同样麻烦的人。我的回答来自https://github.com/burczyk/KBContactsSelection