• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: setting preselected file for nsopenpanel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setting preselected file for nsopenpanel


  • Subject: Re: setting preselected file for nsopenpanel
  • From: Lee Ann Rucker <email@hidden>
  • Date: Mon, 11 Jun 2012 13:47:38 -0700 (PDT)

Nope. I filed a bug (10522782), it got marked as a duplicate of bug 8106339

Mine was:
NSOpenPanel beginForDirectory:file:types:modelessDelegate:didEndSelector:contextInfo:
let you provide an initial selection. The replacement method doesn't.

In addition to having an initial selection, it would be nice to have a way to set selection while the panel is up; for instance, a "Recent Items" in an accessoryView would want to change the selection.

Since it's possible to set the selection with drag and drop, it ought to be possible to do it programmatically.


----- Original Message -----
From: "Dave Fernandes" <email@hidden>
To: "Rick C." <email@hidden>
Cc: "Cocoa-Dev List" <email@hidden>
Sent: Monday, June 11, 2012 8:00:25 AM
Subject: Re: setting preselected file for nsopenpanel

Well, NSOpenPanel inherits from NSSavePanel, so setNameFieldStringValue: might work. I haven't tried this, and I don't know whether there would be sandboxing issues.

On 2012-06-11, at 7:08 AM, Rick C. wrote:

> Hi,
>
> Been through numerous posts on stack overflow without a solution so here goes:
>
> runModalForDirectory:file:types: was deprecated but in the docs it doesn't give the replacement for the file argument.  How can we have a file preselected when running an open panel?
>
> Thanks,
>
> rc
> _______________________________________________
>
> 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


_______________________________________________

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
_______________________________________________

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

References: 
 >Re: setting preselected file for nsopenpanel (From: Dave Fernandes <email@hidden>)

  • Prev by Date: Re: Defining subclasses at run time
  • Next by Date: NSDocument fileWrapperOfType:: invalidates returned wrapper, options?
  • Previous by thread: Re: setting preselected file for nsopenpanel
  • Next by thread: Re: setting preselected file for nsopenpanel
  • Index(es):
    • Date
    • Thread