Creates a new music event iterator.


OSStatus NewMusicEventIterator(MusicTrack inTrack, MusicEventIterator  _Nullable *outIterator);



The music track to iterate over.


On output, the newly created music event iterator.

Return Value

A result code.


A newly-created music event iterator points at the first event on the music track specified in the inTrack parameter.

If you edit a music track after associating it with a music event iterator, you must discard iterator and create a new one. Perform the following steps after editing the track:

  1. Obtain the current position using the MusicEventIteratorGetEventInfo function, and save the position.

  2. Dispose of the music event iterator.

  3. Create a new iterator.

  4. Seek to the desired position using the MusicEventIteratorSeek function.

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