Inherits from NSObject
Conforms to NSCoding
NSCopying
NSFastEnumeration
Declared in RACTuple.h

Overview

A tuple is an ordered collection of objects. It may contain nils, represented by RACTupleNil.

Tasks

Other Methods

ObjectSubscripting Methods

RACSequenceAdditions Methods

  •   rac_sequence

    Returns a sequence of all the objects. RACTupleNils are converted to NSNulls.

    property

Properties

count

@property (nonatomic, readonly) NSUInteger count

fifth

@property (nonatomic, readonly) id fifth

first

@property (nonatomic, readonly) id first
Discussion

These properties all return the object at that index or nil if the number of objects is less than the index.

Declared In

RACTuple.h

fourth

@property (nonatomic, readonly) id fourth

last

@property (nonatomic, readonly) id last

rac_sequence

@property (nonatomic, copy, readonly) RACSequence *rac_sequence
Discussion

Returns a sequence of all the objects. RACTupleNils are converted to NSNulls.

Declared In

RACTuple.h

second

@property (nonatomic, readonly) id second

third

@property (nonatomic, readonly) id third

Class Methods

tupleWithObjects:

+ (instancetype)tupleWithObjects:(id)object, ...
Discussion

Creates a new tuple with the given objects. Use RACTupleNil to represent nils.

Declared In

RACTuple.h

tupleWithObjectsFromArray:

+ (instancetype)tupleWithObjectsFromArray:(NSArray *)array
Discussion

Creates a new tuple out of the array. Does not convert nulls to nils.

Declared In

RACTuple.h

tupleWithObjectsFromArray:convertNullsToNils:

+ (instancetype)tupleWithObjectsFromArray:(NSArray *)array convertNullsToNils:(BOOL)convert
Discussion

Creates a new tuple out of the array. If convert is YES, it also converts every NSNull to RACTupleNil.

Declared In

RACTuple.h

Instance Methods

allObjects

- (NSArray *)allObjects
Discussion

Returns an array of all the objects. RACTupleNils are converted to NSNulls.

Declared In

RACTuple.h

objectAtIndex:

- (id)objectAtIndex:(NSUInteger)index
Discussion

Returns the object at index or nil if the object is a RACTupleNil. Unlike NSArray and friends, it’s perfectly fine to ask for the object at an index past the tuple’s count - 1. It will simply return nil.

Declared In

RACTuple.h

objectAtIndexedSubscript:

- (id)objectAtIndexedSubscript:(NSUInteger)idx
Discussion

Returns the object at that index or nil if the number of objects is less than the index.

Declared In

RACTuple.h

tupleByAddingObject:

- (instancetype)tupleByAddingObject:(id)obj
Discussion

Appends obj to the receiver.

obj - The object to add to the tuple. This argument may be nil.

Returns a new tuple.

Declared In

RACTuple.h