Re: NSSavePanel runModal isn't working in sandbox?
Re: NSSavePanel runModal isn't working in sandbox?
- Subject: Re: NSSavePanel runModal isn't working in sandbox?
- From: Samuel Williams <email@hidden>
- Date: Wed, 06 Jun 2012 16:55:28 +1200
Hi Graham,
What dev forums are you talking about?
NSSavePanel seems completely unusable.
Even the simplest example isn't working for me:
- (void) finishLaunching {
[super finishLaunching];
NSSavePanel * savePanel = [NSSavePanel savePanel];
[savePanel runModal];
NSLog(@"End model session for savePanel: %@", savePanel.URL);
}
That gives nil as a result.
The fact is that the documentation on Apple's site doesn't mention any
existing issues so it is very frustrating to have spent several days
banging my head against these issues wondering if it is something to do
with my code or not... Thanks for clarifying the situation.
Kind regards,
Samuel
On 6 June 2012 16:50, Graham Cox <email@hidden> wrote:
> Are you aware that this class is riddled with severe bugs under the
> current sandbox implementation?
>
> The dev forums will reveal more details.
>
> Also, NSSavePanel doesn't inherit from NSPanel under sandboxing, so if you
> are expecting to use inherited methods, they don't work.
>
> File bugs - we can't adopt sandboxing until these issues are properly
> fixed.
>
>
> --Graham
>
>
>
>
>
> On 06/06/2012, at 1:41 PM, Samuel Williams wrote:
>
> > Hi,
> >
> > I'm having trouble with NSSavePanel runModal in a sandbox:
> >
> > NSSavePanel * savePanel = [NSSavePanel savePanel];
> > savePanel.title = @"Document Migration";
> > savePanel.directoryURL = url;
> > savePanel.nameFieldStringValue = [url lastPathComponent];
> > savePanel.allowedFileTypes = [NSArray arrayWithObject:typeName];
> > savePanel.message = @"Your document needs to be upgraded.";
> >
> > [savePanel setCanSelectHiddenExtension:YES];
> > [savePanel setExtensionHidden:YES];
> >
> > NSInteger result = [savePanel runModal];
> >
> > if (result == NSFileHandlingPanelOKButton) {
> > NSAssert(savePanel.URL != nil, @"NSSavePanel returned nil for URL");
> >
> >
> > Without the sandbox, it works fine, with the sandbox, the savePanel.URL
> is
> > nil.
> >
> > Any ideas what is going on? I looked at the documentation on sandbox and
> it
> > didn't mention anything about runModal. I'm going to try using the
> > completion handler method...
>
>
_______________________________________________
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