Mac Developer Library

Developer

AppKit Framework Reference NSTextList Class Reference

Options
Deployment Target:

On This Page
Language:

NSTextList

An NSTextList object represents a section of text that forms a single list. The visible elements of the list, including list markers, appear in the text as they do for lists created by hand. The list object, however, allows the list to be recognized as such by the text system. This enables automatic creation of markers and spacing. Text lists are used in HTML import and export. More...

Inheritance


Conforms To


Import Statement


import AppKit @import AppKit;

Availability


Available in OS X v10.4 and later.
  • Returns an initialized text list.

    Declaration

    Swift

    init(markerFormat format: String, options mask: Int)

    Objective-C

    - (instancetype)initWithMarkerFormat:(NSString *)format options:(NSUInteger)mask

    Parameters

    format

    The marker format for the text list.

    mask

    The marker options for the text list. Values for mask are listed in Constants.

    Return Value

    An initialized text list.

    Discussion

    The marker format is specified as a constant string, except for a numbering specifier, which takes the form {keyword}. The currently supported values for keyword include:

    • box

    • check

    • circle

    • diamond

    • disc

    • hyphen

    • square

    • lower-hexadecimal

    • upper-hexadecimal

    • octal

    • lower-alpha or lower-latin

    • upper-alpha or upper-latin

    • lower-roman

    • upper-roman

    • decimal

    Thus, for example, @"({decimal})" would specify the format for a list numbered (1), (2), (3), and so on, and @"{upper-roman}" would specify the format for a list numbered I, II, III, IV, and so on. (All of these keywords are included in the Cascading Style Sheets level 3 specification.)

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Returns the marker format string used by the receiver.

    Declaration

    Swift

    var markerFormat: String { get }

    Objective-C

    @property(readonly, copy) NSString *markerFormat

    Return Value

    The marker format string used by the receiver.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Returns the computed value for a specific ordinal position in the list.

    Declaration

    Swift

    func markerForItemNumber(_ itemNum: Int) -> String

    Objective-C

    - (NSString *)markerForItemNumber:(NSInteger)itemNum

    Parameters

    itemNum

    The ordinal position in the list whose computed marker value is desired.

    Return Value

    The computed maker value for itemNum.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Returns the list options mask value of the receiver.

    Declaration

    Swift

    var listOptions: NSTextListOptions { get }

    Objective-C

    @property(readonly) NSTextListOptions listOptions

    Return Value

    The list options mask value of the receiver.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Returns the starting item number for the text list.

    Declaration

    Swift

    var startingItemNumber: Int

    Objective-C

    @property NSInteger startingItemNumber

    Return Value

    The item number.

    Discussion

    The default value is 1. This value will be used only for ordered lists, and ignored in other cases.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.6 and later.

  • Sets the starting item number for the text list.

    Declaration

    Swift

    var startingItemNumber: Int

    Objective-C

    @property NSInteger startingItemNumber

    Parameters

    itemNum

    The item number.

    Discussion

    The default value is 1. This value will be used only for ordered lists, and ignored in other cases.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.6 and later.