Re: NSOpenPanel trouble with leopard
Re: NSOpenPanel trouble with leopard
- Subject: Re: NSOpenPanel trouble with leopard
- From: Adrien Mondot <email@hidden>
- Date: Mon, 3 Dec 2007 18:45:35 +0100
Hi and thanks for your answer...
maybe it's a newbie question but :
This function is called via a connection made in Interface Builder,
isn't it supposed to be executed in the main thread ?
In my app, I use a displayLink thread for rendering, so I changed the
code for something like this (adding CVDisplayLinkStop)
- (IBAction) loadConduite:(id)sender
{
CVDisplayLinkStop(_displayLink);
NSString *conduiteFilename;
NSArray *fileTypes = [NSArray arrayWithObjects:@"xml", nil];
NSOpenPanel *oPanel = [NSOpenPanel openPanel];
int result = [oPanel runModalForTypes:fileTypes];
if (result == NSOKButton) {
conduiteFilename = [oPanel filename];
[self loadConduiteAtPath:conduiteFilename];
}
else return;
CVDisplayLinkStart(_displayLink);
}
However it still doesn't work.
During the call to the
NSOpenPanel *oPanel = [NSOpenPanel openPanel];
the console start to dump some errors :
2007-12-03 18:32:07.155 eMotion[1724:10b] NSOutlineView Warning:
reloadData called while in the middle of doing a reloadData!
and continue to dump this line at each rendering loop (60 times/s)
But I really don't understand why a request for openPanel can make
some error in other objects of my app ?!?
Anyway thanks again for your help,
Adrien
Le 3 déc. 07 à 16:29, John Stiles a écrit :
You can only execute that code on the main thread. The open panel is
not thread safe.
_______________________________________________
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