swift - Stop async operations on window close -


in app delegate have put callback stop program when window shut.

 func applicationshouldterminateafterlastwindowclosed(sender: nsapplication) -> bool {         return true     } 

this doesn't work because (i assume) there async bluetooth task running. best way stop running , clean up?

i use approach

[nsapp performselector:@selector(terminate:) withobject:nil afterdelay:0]; 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -