再谈阻断用户界面

源自:http://stackoverflow.com/questions/1697029/ignoring-ui-events-in-appkit

 

if I wanted to ignore a touch event in UIKit on the iPhone I would simply do:

// Begin ignoring events
[[UIApplication sharedApplication] beginIgnoringInteractionEvents];
//Do my code
// Stop ignoring events
[[UIApplication sharedApplication] endIgnoringInteractionEvents];

This allows my code in between the "ignore" calls to operate without having to worry about user interaction changing any state of the application.

你可能感兴趣的:(user,iPhone,events)