¡@

Home 

2014/10/15 ¤U¤È 10:12:47

iphone Programming Glossary: pleaseabandonyourefforts

Can you use cancel/isCancelled with GCD/dispatch_async?

http://stackoverflow.com/questions/5449469/can-you-use-cancel-iscancelled-with-gcd-dispatch-async

or animate something to show the processor is working . Here's how we do it... @interface AstoundingView UIView BOOL pleaseAbandonYourEfforts blah @implementation AstoundingView these are the foreground routines... begin abandon and all done void userHasClickedToBuildASpaceship.. self procedurallyBuildEnormousSpaceship void userHasClickedToAbandonBuildingTheSpaceship YourUIStateMachine inbetween pleaseAbandonYourEfforts false that's it void attentionBGIsAllDone you get here when the process finishes whether by completion or if we have asked.. to home eg progress messages void procedurallyBuildEnormousSpaceship user has clicked button to build new spaceship pleaseAbandonYourEfforts FALSE dispatch_async dispatch_get_global_queue DISPATCH_QUEUE_PRIORITY_HIGH 0 ^ self actuallyProcedurallyBuildInBackground..