From: Neil S. <ne...@ha...> - 2005-11-26 23:51:56
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jonathan Paisley wrote: > You may need stopAnimation(nil), which is a method on > NSProgressIndicator, whereas stopAnimation_ is defined on NSAnimation. > That might fix it. Good call. I just slapped a nil onto startAnimation and stopAnimation, and it's nice and neat now. I don't even need those hanging underscores anymore, which suggests to me that the reason I needed them was possibly that I was missing the argument. > Sorry, I should have been clearer in my original post. > > self.performSelector doesn't help any here - it just ends up calling > back on the same thread. There are some other performSelector... > methods that are of use, in particular > performSelectorOnMainThread_withObject_waitUntilDone. This schedules a > call during a pass on the main thread runloop. It's important to always > give 'waitUntilDone' as false here, because otherwise it degenerates > into a direct call like performSelector. > > I need to have more of a think about the thread safety here, but it's > possible that everything will work out if you fix stopAnimation(nil) - > without needing to do the performSelector... stuff at all. > > Let me know how you get on. It worked just doing the calls from the secondary thread, but just in case, I've switched it to use performSelectorOnMainThread_withObject_waitUntilDone, and it's still working great. Thank you very much. Without this threading my little XHTML validator would be unpleasant to use, with its frozen UI during the checking and all. Thanks again! - -- Neil Stevens - ne...@ha... 'A republic, if you can keep it.' -- Benjamin Franklin -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) iD8DBQFDiPUaf7mnligQOmERArMIAJwJooyYGAir8hpwG6U0WoS5UToBaACfcQj7 Rj5OMn50Rk6nGL7AdoLDCvI= =p2fO -----END PGP SIGNATURE----- |