Re: OSX have that is equivalent to WaitMessage() Win32 API
Re: OSX have that is equivalent to WaitMessage() Win32 API
- Subject: Re: OSX have that is equivalent to WaitMessage() Win32 API
- From: Jens Alfke <email@hidden>
- Date: Sun, 18 Oct 2009 23:27:16 -0700
You're looking for CFRunLoop (or NSRunLoop if you want to use
Objective-C), which is the way event loops and event handling work on
Mac OS X.
But there isn't a function like WaitMessage, because the loop is
inside-out — instead of writing your own event loop, the system runs
it, and calls you when things happen.
IMHO trying to port code from another platform literally like this is
doomed to failure, just like attempting to translate a French novel
into English by using Google Translate. What you should do instead is
learn to write programs for OS X (preferably in Cocoa), then implement
the program for that platform, bringing in as much of the existing
code as possible (but not more.)
—Jens_______________________________________________
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