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

Overview

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

Properties

first

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

@property (nonatomic, readonly) id first

Declared In

RACTuple.h

rac_sequence

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

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

Declared In

RACTuple.h

Class Methods

tupleWithObjects:

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

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

Declared In

RACTuple.h

tupleWithObjectsFromArray:

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

+ (instancetype)tupleWithObjectsFromArray:(NSArray *)array

Declared In

RACTuple.h

tupleWithObjectsFromArray:convertNullsToNils:

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

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

Declared In

RACTuple.h

Instance Methods

allObjects

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

- (NSArray *)allObjects

Declared In

RACTuple.h

objectAtIndex:

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.

- (id)objectAtIndex:(NSUInteger)index

Declared In

RACTuple.h

objectAtIndexedSubscript:

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

- (id)objectAtIndexedSubscript:(NSUInteger)idx

Declared In

RACTuple.h

tupleByAddingObject:

Appends obj to the receiver.

- (instancetype)tupleByAddingObject:(id)obj

Discussion

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

Returns a new tuple.

Declared In

RACTuple.h