Re: NSOpenPanel Exception/Bug
Re: NSOpenPanel Exception/Bug
- Subject: Re: NSOpenPanel Exception/Bug
- From: Seth Willits <email@hidden>
- Date: Wed, 29 Jul 2009 15:44:26 -0700
On Jul 28, 2009, at 11:24 PM, Kyle Sluder wrote:
On Jul 28, 2009, at 11:12 PM, Seth Willits <email@hidden>
wrote:
Yes. It just fires off a task.
Is there a particular reason you're doing this instead of using UTIs?
UTIs are useless for determining what the actual content is if the
extension (etc) isn't common. For example, a .cnfg text file is just
"public.data" since no one claims it as text. /usr/bin/file will open
the actual file and determine if it's text. That's why this code has
various stages. After all else fails to identify the file as being
text, the very last stage is to just open the file and look at it.
I've yet to find a better method.
[task waitUntilExit];
Doing this while displaying an open panel might not be a good idea,
especially if it's waiting on the current runloop to fetch some
information. Like perhaps network volumes shown in the sidebar.
I think you're right on here (although I think it would still be an
NSOpenPanel bug). I'd try doing the equivalent of waitUntilExit
using a different runloop mode:
I can see that this is likely the only spot for any potential trouble,
but it'd be pretty stupid if it does. :\
At any rate, I've changed the code. I guess I'll just have to wait and
see if I get any crash reports.
--
Seth Willits
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden