I'm curious as to how to make a Cocoa(java) application not "freeze" when a long process is running.
In my small example program I have a "go" button that sets in motion a long loop. While this is running I'd like the user to still be able to use the application. Right now its entire interface freezes while this loop is running.
I've tried making a new class (extends Thread) that contains the loop. My "go" button merely sets that thread in motion. But the interface still freezes until the loop is finished.
It would seem that my "go" action isn't returning until the thread is dead. I'm rather new to threads and have been thus far unable to find the answer. Any insight would be greatly appreciated
Code:
public void go(Object sender) { /* IBAction */
threader = new Threader();
threader.run();
}