Re: [NSSound isPlaying] fails to indicate sound termination in Lion
Re: [NSSound isPlaying] fails to indicate sound termination in Lion
- Subject: Re: [NSSound isPlaying] fails to indicate sound termination in Lion
- From: Gavin Stokes <email@hidden>
- Date: Sun, 22 Jul 2012 23:45:42 -0700
>
> Asynchronous programming means you'll be called back when things happen,
> and in the meantime you should return control so other stuff can run. It
> doesn't mean that you should go into an infinite loop trying to force
> something async to run synchronously.
>
That question was rhetorical. The point is that, for a newcomer to this
kind of programming, it can be perplexing to figure out what the "other
stuff" is that can run, when in fact the entire state of the application
may be invalid until some asynchronous process returns a result.
For example, I have an app that literally will not function unless it can
make a network connection; it is useless without one. But I don't freeze
the whole thing waiting for a response; I display a status message.
iCloud is another good example, since you really have no idea what it's
doing or if it will ever get back to you. Apple says it's a good place to
store things like what page of an article your user was reading on another
device, so he can start right there on a different device. But you have no
idea when or if that key/value pair will be returned from iCloud, so your
application must do something in the meantime at startup.
It seems obvious after you've dealt with this a while, but at first it's a
hurdle.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden