Sunday, December 8, 2013

Under Mac OS X similar to the Windows message handler

 
void secondsLatterProcessEvents (unsigned int time)
{
MSG msg;
while (true)
{
while (PeekMessage (& msg, NULL, 0, 0, PM_REMOVE))
{TranslateMessage (& msg);
DispatchMessage (& msg);
}
sleep (100);
time - = 100;
if (time <= 0) break;
}
}




How compiler environment under Mac Xcode same function, that is, for a process, the pause for some time, but does not affect message processing threads. .
Reply:
windows message handler less likely. . . Less contact.

If you want to pop up a message box on the mac os, there are two methods that comes

UIActionSheet: (ask box: OK, Cancel) using
same warning box (below that)UIAlertView * a = [[UIAlertView alloc] initWithTitle: (NSString *) title
message: (NSString *) message
delegate: self
cancelButtonTitle: (NSString *) cancelButtonTitle
otherButtonTitles: nil];
[A show];
[A release];
Reply:
no body!
Reply:
runloop

No comments:

Post a Comment