Mac Developer Library

Developer

DRMSFFormatter Class Reference

Options
Deployment Target:

On This Page
Language:

DRMSFFormatter

NSFormatter subclass

Instances of DRMSFFormatter format the textual representation of cells that contain MSF objects and convert textual representations of msf values into MSF objects. DRMSFFormatters are typically instantiated in IB using the DiscRecording Interface builder palette.

Inheritance


Conforms To


Import Statement


Swift

import DiscRecording

Objective-C

@import DiscRecording;

Availability


Available in OS X v10.2 and later.
  • Returns the format string to the caller

    Declaration

    Swift

    func format() -> String!

    Objective-C

    - (NSString *)format

    Import Statement

    Objective-C

    @import DiscRecording;

    Swift

    import DiscRecording

    Availability

    Available in OS X v10.2 and later.

  • Initializes the formatter with the format string

    Declaration

    Swift

    init!(format format: String!)

    Objective-C

    - (id)initWithFormat:(NSString *)format

    Parameters

    format

    An NString specifying the printf-style format string.

    Return Value

    A DRMSFFormatter

    Import Statement

    Objective-C

    @import DiscRecording;

    Swift

    import DiscRecording

    Availability

    Available in OS X v10.2 and later.

  • Sets the format string of the receiver

    Declaration

    Swift

    func setFormat(_ format: String!)

    Objective-C

    - (void)setFormat:(NSString *)format

    Parameters

    format

    An NString specifying the printf-style format string.

    Discussion

    The format string is very similar to a printf-style format string with %-escaped formatting characters.

    • %% A "%" character

    • %m Minutes as a decimal number

    • %s Seconds as a decimal number

    • %f Frames as a decimal number

    In addition to these formatting characters an optional length specifier can come between then % and the formatting character. This length specifier will force the field in question to be at least that wide. for example a format specifier of "%02m:%02s" will cause a DRMSF object representing 3 minutes 9 seconds to be formatted as "03:09".

    A formatter is aware of and respects rounding. If a bit of the msf is not zero, but the format does not display that value, the next higher value will be increased by one to reflect that. Extending our example above, an DRMSF with a value of 3 minutes, 9 seconds, 15 frames using a format specfier of "%02m:%02s", will be formatted as "03:10" since the 15 frames rounds up the seconds to the next value

    Import Statement

    Objective-C

    @import DiscRecording;

    Swift

    import DiscRecording

    Availability

    Available in OS X v10.2 and later.