Inherits from CCActionInstant : CCFiniteTimeAction : CCAction : NSObject
Declared in CCSendMessages.h

Overview

@class CCSendMessages CCActionInstant that sends messsages to a target when it is run.

It is different than the CCCallFunc classes in that any message can be sent to a target regardless of the number/type of arguments.

NOTE: Any selector in the NSObject class and any selector in the NSObject and NSCopying protocals cannot be added via -addMessage. If you need to call one of those selectors, create an NSInvocation and add it via -addInvocation:.

Usage:

Create a CCSendMessages instance with a target using -initWithTarget: or
+actionWithTarget:

Add message call(s) to it:
    (assuming sendMessages is your CCSendMessages object)
    [[sendMessages addMessage] setOpacity:0.5];
    [[sendMessages addMessage] long:0.5 selector:obj example:ccp(3,3)];

Run it on a CCNode with -runAction:, or add it to a
CCSequence to run it later on!

Also, arguments don't have to be Objective-C objects.

Tasks

  • + actionWithTarget:

    Creates CCSendMessages action with given target. @see initWithTarget:

  • – initWithTarget:

    Init CCSendMessages action with given target

  • – addMessage

    Returns CCStoredMessages that is stored internally to capture Objective-C messages.

  • – addInvocation:

    Adds NSInvocation to internal CCStoredMessages, use this method to send NSObject & NSCopying selectors to a target.

  • – execute

    Sends all captured messages to a target.

Class Methods

actionWithTarget:

Creates CCSendMessages action with given target. @see initWithTarget:

+ (id)actionWithTarget:(id)t

Declared In

CCSendMessages.h

Instance Methods

addInvocation:

Adds NSInvocation to internal CCStoredMessages, use this method to send NSObject & NSCopying selectors to a target.

- (void)addInvocation:(NSInvocation *)invocation

Declared In

CCSendMessages.h

addMessage

Returns CCStoredMessages that is stored internally to capture Objective-C messages.

- (id)addMessage

Declared In

CCSendMessages.h

execute

Sends all captured messages to a target.

- (void)execute

Discussion

You don’t need to use this method directly – use CCNode#runAction: instead.

Declared In

CCSendMessages.h

initWithTarget:

Init CCSendMessages action with given target

- (id)initWithTarget:(id)t

Parameters

t

Target, which will receive messages.

Declared In

CCSendMessages.h