---
title: "[ios] performSelector无法传多个参数解决办法"
author: "119568242"
date: "2013-07-26T11:19:02Z"
tags: []
categories: ["移动开发"]
slug: "ios-performselector"
draft: false
lastmod: "2013-07-26T11:19:02Z"
id: 1913908
url: "https://poolo.iteye.com/blog/1913908"
---

\[self performSelector:&lt;#(SEL)#&gt; withObject:&lt;#(id)#&gt; afterDelay:&lt;#(NSTimeInterval)#&gt;]无法传多个参数

解决方案1：把参数打包成一个VO或者数组

解决方案2：导入#import &lt;objc/message.h&gt;包

使用objc\_msgSend(self,@selector(testObj:int:),10,40);

 

函数的第 1 个参数指向消息的接收者(即该方法的对象),第 2 个参数是一个选择器(即 方法),第 3 个参数是一个可变参数,是该方法的 1 个或多个参数,如果该方法没有参数,用 一个 nil 代替。