• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Interface not receiving messages until action method completes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Interface not receiving messages until action method completes


  • Subject: Re: Interface not receiving messages until action method completes
  • From: Laurent Michel <email@hidden>
  • Date: Wed, 4 Jan 2006 07:54:19 -0500

You are tying up the main thread inside the play method of the music object. So the message loop cannot react to inbound events like
- redraw request
- window resizing
- or any other kind of events


You should run the play method in a separate _thread_. Check the NSThread documentation. Detach a thread and run play on music within that thread and all will be fine. (or course, the music object will be shared by the two threads, so be careful and synchronize where needed).


On Jan 3, 2006, at 10:11 PM, F. C. Rock wrote:

Much appreciate help with this:

I click on a button on my interface. The button is connected to the following action:

- (IBAction)play:(id)sender
{
	[self cueMusic: nil];
	[music play];
	return;
}

cueMusic is an action connected to another button on the same interface. It highlights the button.
The problem is that "cueMusic:" button doesn't get highlighted until after the program returns from -play:.
I also have a clock displayed on this interface and the display ceases to update until after the program returns from -play:.


Can anyone tell me what's happening here - and how to fix it?

Fred


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40thorgal.homelinux.org


This email sent to email@hidden

-- Laurent


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Interface not receiving messages until action method completes (From: "F. C. Rock" <email@hidden>)

  • Prev by Date: Re: Synchronized outlets and actions
  • Next by Date: RE: UNICODE from a WinTel box
  • Previous by thread: Interface not receiving messages until action method completes
  • Next by thread: insertText
  • Index(es):
    • Date
    • Thread