NSIndexPath+Etoile documentation

Authors

Quentin Mathe (qmathe@club-internet.fr)
Additions to NSIndexPath.

Copyright: (C) 2007 Quentin Mathe

Software documentation for the NSIndexPath(Etoile) category

NSIndexPath(Etoile)

Declared in:
NSIndexPath+Etoile.h

@group Collection Additions

Method summary

indexPath 

+ (NSIndexPath*) indexPath;

Returns a new autoreleased empty index path.


indexPathWithString: 

+ (NSIndexPath*) indexPathWithString: (NSString*)aPath;

Returns a new autoreleased index path initialized with a index path string representation.

The string representation must use . as separator. For example, 5.6.7.


firstIndex 

- (NSUInteger) firstIndex;

Returns the first path component in the index path.


indexPathByRemovingFirstIndex 

- (NSIndexPath*) indexPathByRemovingFirstIndex;

Returns a new autoreleased index path by removing the first path component.


lastIndex 

- (NSUInteger) lastIndex;

Returns the last path component in the index path.


stringByJoiningIndexPathWithSeparator: 

- (NSString*) stringByJoiningIndexPathWithSeparator: (NSString*)separator;

Returns an autoreleased string representation by joining each index path component with the given separator.

e.g. '5/6/7' with '/' as separator or '5.6.7' with '.' as separator.

Will raise an NSInvalidArgumentException if the separator is nil.


stringValue 

- (NSString*) stringValue;

Returns a string representation of the receiver.

Take note that KVC as implemented by Foundation collection classes such as NSArray doesn't support to look up elements with a key like '5' or a key path like '6.name'. -valueForKey: and -valueForKeyPath: would try to lookup 5 and 6 as ivar or method names.