Re: NSSound needs a run loop cycle to repeat-play
a sound?

On Sat, Mar 28, 2009 at 2:11 AM, Jerry Krinock <jerry@xxxxxxxx> wrote:
> If I invoke NSSound to play the same sound more than once, without cycling
> through a run loop, it only plays the first time, and other times, fails
> "silently". [1]
> If I cycle through a run loop, then it works fine. [2]
> The documentation states that NSSounds play in a separate thread and I don't
> see any explanation for this in "Sound Programming Topics for Cocoa". ÂIs
> this a bug or is it too late for me to be trying to read?

I'd call it a documentation deficit. Probably worth filing a bug
reading, roughly, "Half of the APIs in Cocoa assume that the calling
thread has an active runloop, but aren't documented as having this
requirement." NSSound is far from alone in this respect.


Cocoa-dev mailing list (Cocoa-dev@xxxxxxxxxxxxxxx)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)

Help/Unsubscribe/Update your Subscription:

This email sent to maillists@xxxxxxxxx