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.
我想调用一个函数,使我的主线程使用上述函数卡住,以便它可以在差异线程中运行。但问题是我的函数有 2 个参数。有可能这样做吗?
只需将使用函数所需的所有参数构建的对象作为对象传递NSDictionary(使用字典甚至可以超过两个)。
NSDictionary
在与您作为选择器传递的函数相关的代码中,您然后从字典中检索您的参数作为存储在字典中的对象。