Re: NSOpenPanel trouble with leopard
Re: NSOpenPanel trouble with leopard
- Subject: Re: NSOpenPanel trouble with leopard
- From: John Stiles <email@hidden>
- Date: Mon, 3 Dec 2007 07:29:34 -0800
You can only execute that code on the main thread. The open panel is
not thread safe.
On Dec 3, 2007, at 2:01 AM, Adrien Mondot wrote:
Hello,
I'm getting some trouble to make my cocoa app work with leopard : I
converted it to Objective C 2.0, it compiles fine, great. However
one critical part don't work as expected at runtime : it's
impossible to make appear any open file dialog.
I changed my code to use one of the leopard samples, so it's very
simple :
- (IBAction) loadConduite:(id)sender
{
NSLog(@"load conduite");
NSString *conduiteFilename;
NSArray *fileTypes = [NSArray arrayWithObjects:@"xml", nil];
NSOpenPanel *oPanel = [NSOpenPanel openPanel];
NSLog(@"after openPanel");
int result = [oPanel runModalForTypes:fileTypes];
if (result == NSOKButton) {
conduiteFilename = [oPanel filename];
NSLog(@"load conduite2b");
//[renderWindow setLevel:2];
[self loadConduiteAtPath:conduiteFilename];
conduiteFilePath = conduiteFilename;
[conduiteFilePath retain];
NSLog(@"load conduite3");
}
else return;
NSLog(@"load conduite4");
}
at runtime the line after NSOpenPanel *oPanel = [NSOpenPanel
openPanel]; is never executed and the program continue normally,
like if the thread for opening just stoped.
Another simple program wih the same code is working properly.
Does someone as any clue or idea of where the problem is ?
Thanks
Adrien
_________________
www.adrienm.net/emotion/
_______________________________________________
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:
40blizzard.com
This email sent to email@hidden
_______________________________________________
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