• 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: NSSavePanel runModalForDirectory, set name selection?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSSavePanel runModalForDirectory, set name selection?


  • Subject: Re: NSSavePanel runModalForDirectory, set name selection?
  • From: Henrietta Read <email@hidden>
  • Date: Thu, 30 Apr 2009 19:26:04 -0700

Perhaps I'm not understanding properly, but are you suggesting that I use
NSOpenPanel to save files?

That doesn't make any sense...




On Thu, Apr 30, 2009 at 3:14 PM, Tom Hohensee <email@hidden> wrote:

> HenriettaYou have to use NSFileManager  displaynameAtPath:  in conjuction
> with NSOpenPanel.  Here is some sample code I hope helps
>
> //Run the open panel
> [panel beginSheetForDirectory:nil file:nil types:fileTypesArray
> modalForWindow:[self window] modalDelegate:self didEndSelector:@selector(
> openPanelDidEnd:returnCode:contextInfo:)contextInfo:NULL];
>
> -(void)openPanelDidEnd:(NSOpenPanel*)sheet
> returnCode:(int)returnCode
> contextInfo:(void*)contextInfo {
>  //Did they choose open
> if (returnCode == NSOKButton)
> {
>  NSFileManager *fileManager = [NSFileManager defaultManager];
> NSString *displayNameAtPath = [fileManager displayNameAtPath:[sheet
> filename]];
>  .........
> ....
> ..
> .
> }
> }
>
> Tom
>
>
> On Apr 30, 2009, at 3:28 PM, Henrietta Read wrote:
>
> Question,
>
> I'm passing a file name such as 'MyTextFile.txt' to NSSavePanel
> runModalForDirectory.
>
> When the panel appears the entire string is selected, but I would rather
> that just
> 'MyTextFile' is selected. Is it possible to set the selection to exclude
> the
> file
> extension?
>
>
> Thank you.
> _______________________________________________
>
> 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: 
 >NSSavePanel runModalForDirectory, set name selection? (From: Henrietta Read <email@hidden>)

  • Prev by Date: Re: Repositioning the Field Editor [solved]
  • Next by Date: Modifying NSTableView cell data just prior to invoking field editor
  • Previous by thread: NSSavePanel runModalForDirectory, set name selection?
  • Next by thread: Creating a custom hierarchical list view
  • Index(es):
    • Date
    • Thread