NSRunLoop (sometimes) runs away
NSRunLoop (sometimes) runs away
- Subject: NSRunLoop (sometimes) runs away
- From: Thomas Harrington <email@hidden>
- Date: Mon, 21 Oct 2002 15:02:39 -0600
I have a project which includes a faceless helper tool that needs to
have a run loop. Since the loop's not going to be run automatically, I
used this:
NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
...later ...
[runLoop run];
This worked great for me, and for all of my beta testers.
When the software got out into the field I got some bug reports that
suggested the helper tool was not completing its run. After some
research, I found that in these cases, the [runLoop run] line basically
spun off into the ether somewhere and never returned. This after
executing the same sequence of instructions as on other Macs where it
worked normally.
I wasn't able to correlate this to any particular release of Mac OS X,
or to any type of hardware. The reports covered a variety of systems.
However, if a Mac has this problem, it _always_ has this problem.
I've worked around it by what seems a fairly crufty workaround in which
I repeatedly call -[NSRunLoop runUntilDate], while also checking to see
if I should keep making these calls. This has fixed things on the
affected systems, but I still have no idea why the original was a
problem. Presumably some other kind of data source became attached to
the run loop, but why would the same sequence of steps lead to that
situation on some Macs but not on others?
--
Tom Harrington
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.