Next Page > Hide TOC

NSPositionalSpecifier Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/Foundation.framework
Availability
Available in Mac OS X v10.0 and later.
Companion guide
Declared in
NSScriptObjectSpecifiers.h

Overview

Instances of NSPositionalSpecifier specify an insertion point in a container relative to another object in the container, for example, before first word or after paragraph 4. The container is specified by an instance of NSScriptObjectSpecifier. NSPositionalSpecifier objects commonly encapsulate object specifiers used as arguments to the make (create) and move commands and indicate where the created or moved object is to be inserted relative to the object represented by an object specifier.

Invoking an accessor method to obtain information about an instance of NSPositionalSpecifier causes the object to be evaluated if it hasn’t been already.

You don’t normally subclass NSPositionalSpecifier.

Tasks

Initializing a Positional Specifier

Accessing Information About a Positional Specifier

Evaluating a Positional Specifier

Instance Methods

evaluate

Causes the receiver to evaluate its position.

- (void)evaluate

Discussion

Calling insertionContainer, insertionKey, insertionIndex, or insertionReplaces also causes the receiver to be evaluated, if it hasn’t already been evaluated.

Availability
Declared In
NSScriptObjectSpecifiers.h

initWithPosition:objectSpecifier:

Initializes a positional specifier with a given position relative to another given specifier.

- (id)initWithPosition:(NSInsertionPosition)position objectSpecifier:(NSScriptObjectSpecifier *)specifier

Parameters
position

The position for the new specifier relative to specifier.

specifier

The reference specifier.

Return Value

An initialized positional specifier with the position specified by position relative to the object specified by specifier.

Availability
Declared In
NSScriptObjectSpecifiers.h

insertionContainer

Returns the container in which the new or copied object or objects should be placed.

- (id)insertionContainer

Return Value

A container. Determined by evaluating the receiver.

Availability
Declared In
NSScriptObjectSpecifiers.h

insertionIndex

Returns an insertion index that indicates where the new or copied object or objects should be placed.

- (NSInteger)insertionIndex

Return Value

An insertion index. Determined by evaluating the receiver.

Availability
Declared In
NSScriptObjectSpecifiers.h

insertionKey

Returns the key that identifies the relationship into which the new or copied object or objects should be inserted.

- (NSString *)insertionKey

Return Value

A key. Determined by evaluating the receiver.

Availability
Declared In
NSScriptObjectSpecifiers.h

insertionReplaces

Returns a Boolean value that indicates whether evaluation has been successful and the object to be inserted should actually replace the keyed, indexed object in the insertion container.

- (BOOL)insertionReplaces

Return Value

YES if evaluation has been successful and the object to be inserted should actually replace the keyed, indexed object in the insertion container, instead of being inserted before it; NO otherwise.

Discussion

If this object has never been evaluated, evaluation is attempted.

Availability
Declared In
NSScriptObjectSpecifiers.h

objectSpecifier

Returns the object specifier specified at initialization time.

- (NSScriptObjectSpecifier *)objectSpecifier

Return Value

An object specifier for a container.

Availability
Declared In
NSScriptObjectSpecifiers.h

position

Returns the insertion position specified at initialization time.

- (NSInsertionPosition)position

Return Value

An insertion position.

Availability
Declared In
NSScriptObjectSpecifiers.h

setInsertionClassDescription:

Sets the class description for the object or objects to be inserted.

- (void)setInsertionClassDescription:(NSScriptClassDescription *)classDescription

Parameters
classDescription

The class description for the object or objects to be inserted.

Discussion

This message can be sent at any time after object initialization, but must be sent before evaluation to have any effect.

Availability
Declared In
NSScriptObjectSpecifiers.h

Constants

NSInsertionPosition

The following constants are defined by NSPositionalSpecifier to specify an insertion position.

typedef enum {
   NSPositionAfter,
   NSPositionBefore,
   NSPositionBeginning,
   NSPositionEnd,
   NSPositionReplace
} NSInsertionPosition;

Constants
NSPositionAfter

Specifies a position after another object.

Available in Mac OS X v10.0 and later.

Declared in NSScriptObjectSpecifiers.h.

NSPositionBefore

Specifies a position before another object.

Available in Mac OS X v10.0 and later.

Declared in NSScriptObjectSpecifiers.h.

NSPositionBeginning

Specifies a position at the beginning of a collection.

Available in Mac OS X v10.0 and later.

Declared in NSScriptObjectSpecifiers.h.

NSPositionEnd

Specifies a position at the end of a collection.

Available in Mac OS X v10.0 and later.

Declared in NSScriptObjectSpecifiers.h.

NSPositionReplace

Specifies a position in the place of another object.

Available in Mac OS X v10.0 and later.

Declared in NSScriptObjectSpecifiers.h.

Discussion

These constants are described in NSPositionalSpecifier.

Availability
Declared In
NSScriptObjectSpecifiers.h

Next Page > Hide TOC


© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-06-29)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.