NSXPCInterface Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/Foundation.framework |
| Availability | Available in OS X v10.8 and later. |
| Declared in | NSXPCConnection.h |
Overview
Class that describes the methods that may be sent to an exported object or remote object proxy.
This object holds all information about the interface of an exported object or remote object proxy. It describes what messages are allowed, what kinds of objects are allowed as arguments, what the signature of any reply blocks are, and information about additional proxy objects.
Properties
protocol
The Objective-C protocol that this interface is based on.
Availability
- Available in OS X v10.8 and later.
Declared In
NSXPCConnection.hClass Methods
interfaceWithProtocol:
Returns an NSXPCInterface instance for a given protocol.
Discussion
Most interfaces do not need any further configuration. Interfaces with collection classes or additional proxy objects should be configured using the other methods in this class.
Availability
- Available in OS X v10.8 and later.
Declared In
NSXPCConnection.hInstance Methods
classesForSelector:argumentIndex:ofReply:
Returns the current list of allowed classes that can appear within the specified collection object argument to the specified method.
Parameters
- sel
Specifies which method in the protocol you want information about.
- arg
Specifies the position (starting at index 0) of the parameter for which you want to obtain the current set of allowed classes. This may be either the position of a parameter in the method itself or the position in its reply block.
- ofReply
Pass
YESifargis an index into the parameters of the reply block, orNOif it is an index into the parameters of the method itself.
Discussion
See setClasses:forSelector:argumentIndex:ofReply: for more explanation.
Availability
- Available in OS X v10.8 and later.
Declared In
NSXPCConnection.hinterfaceForSelector:argumentIndex:ofReply:
Returns the interface previously set for the specified selector and parameter.
Parameters
- sel
Specifies which method in the protocol you want information about.
- arg
Specifies the position (starting at index 0) of the parameter for which you want to obtain the current interface. This may be either the position of a parameter in the method itself or the position in its reply block.
- ofReply
Pass
YESifargis an index into the parameters of the reply block, orNOif it is an index into the parameters of the method itself.
Discussion
See setInterface:forSelector:argumentIndex:ofReply: for more explanation.
Availability
- Available in OS X v10.8 and later.
Declared In
NSXPCConnection.hsetClasses:forSelector:argumentIndex:ofReply:
Sets the classes that can appear within the (numerically) specified collection object argument to the specified method.
Parameters
- classes
An
NSSetcontaining Class objects—for example,[MyObject class].- sel
Specifies which method in the protocol is being configured.
- arg
Specifies the position (starting at index 0) of the parameter for which you are allowing classes. This may be either the position of a parameter in the method itself or the position in its reply block.
- ofReply
Pass
YESifargis an index into the parameters of the reply block, orNOif it is an index into the parameters of the method itself.
Discussion
If an argument to a method in your protocol is a collection class (for example, NSArray or NSDictionary), then you must explicitly specify the set of expected classes that may appear within that collection.
If the expected classes are all property list types, calling this method is optional; property list types are allowed by default inside collection objects. You may, however, call this method to further restrict the set of allowed classes.
Availability
- Available in OS X v10.8 and later.
Declared In
NSXPCConnection.hsetInterface:forSelector:argumentIndex:ofReply:
Configures a specific parameter of a method to be sent as a proxy object instead of copied.
Parameters
- ifc
The
NSXPCInterfaceobject that describes the protocol for the proxy object. The interface is configured the same way as the interface for an exported object or remote object proxy.- sel
Specifies which method in the protocol is being configured.
- arg
Specifies the position (starting at index 0) of the parameter for which you are configuring a proxy object. This may be either the position of a parameter in the method itself or the position in its reply block. This argument must be an object.
- ofReply
Pass
YESifargis an index into the parameters of the reply block, orNOif it is an index into the parameters of the method itself.
Discussion
If an argument to a method in your protocol should be sent as a proxy object instead of by copy, then configure the interface for that protocol with a new interface for a specific argument. An example of an object that should be a proxy instead of being copied is a view object.
Availability
- Available in OS X v10.8 and later.
Declared In
NSXPCConnection.h© 2012 Apple Inc. All Rights Reserved. (Last updated: 2012-07-23)