I have a separate thread running a function. The function will check if it can do something, and if not possible I want the program to inform the user and end.
I know about exit (0). I wasn’t sure if it works on all threads or only in main.
Is there a way I can end the program from a separate thread if a condition is not met?
You can use the singleton for NSThread
Otherwise if you’re using Grand Central Dispatch you can access the main queue and fire it.