首页 > 代码库 > NSObject的performSelector: withObject: withObject:使用简介

NSObject的performSelector: withObject: withObject:使用简介

- (id)performSelector:(SEL)aSelector withObject:(id)anObject withObject:(id)anotherObject

Description

[说明]

Sends a message to the receiver with two objects as arguments. (required)

[将消息发送到与两个对象作为参数接收。(必填)]

 

This method is the same as performSelector: except that you can supply two arguments for aSelector. aSelector should identify a method that can take two arguments of type id. For methods with other argument types and return values, use NSInvocation.

[这种方法是一样的performSelector:除非你能提供两个参数的aSelector。 aSelector应该确定可以采取id类型的两个参数的方法。与其他类型的参数和返回值的方法,使用NSInvocation。]

Parameters

[参数]

aSelector

A selector identifying the message to send. If aSelector is NULL, an NSInvalidArgumentException is raised.

[选择器确定要发送的消息。如果aSelector为NULL,一个NSInvalidArgumentException提高。]

anObject

An object that is the first argument of the message.

[一个对象,它是消息的第一个参数。]

anotherObject

An object that is the second argument of the message.

[一个对象,它是消息的第二个参数。]

Returns

[返回]

An object that is the result of the message.

[一个对象,该对象是消息的结果。]

Availability

OS X (10.0 and later)

Declared In

NSObject.h

Reference

NSObject Protocol Reference

NSObject的performSelector: withObject: withObject:使用简介