Positions a music event iterator at the previous event on a music track.


func MusicEventIteratorPreviousEvent(_ inIterator: MusicEventIterator) -> OSStatus



The music event iterator to reposition.

Return Value

A result code.


Use this function to decrement a music event iterator, moving it backward through a music track’s events.

If an iterator is at the first event of a track when you call this function, the iterator position remains unchanged and this function returns an error.

The following code snippet illustrates how to use a music event iterator to proceed backward along a music track, from the end:

// Points iterator just beyond the final event on its music track
MusicEventIteratorSeek (myIterator, kMusicTimeStamp_EndOfTrack);
bool hasPreviousEvent;
MusicEventIteratorHasPreviousEvent (myIterator, &hasPreviousEvent);
while (hasPreviousEvent) {
    MusicEventIteratorPreviousEvent (myIterator);
        // do work here
    MusicEventIteratorHasPreviousEvent (myIterator, &hasPreviousEvent);

See Also

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software