• 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 Example
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSSavePanel Example


  • Subject: Re: NSSavePanel Example
  • From: Tyson Tate <email@hidden>
  • Date: Sun, 27 Jul 2003 23:13:19 -0700

Although I received no replies, I eventually found a clean example at: http://www.oomori.com/cocoafw/ApplicationKit/NSSavePanel/filename.html

I'm posting this for reference (this mailing list is archived, right?).

-------------------------------------------
- (IBAction)pushButton:(id)sender
{
NSSavePanel *spanel = [NSSavePanel savePanel];
NSString *path = @"/Documents";
[spanel setDirectory:[path stringByExpandingTildeInPath]];
[spanel setPrompt:NSLocalizedString(@"save_ok",nil)];
[spanel setRequiredFileType:@"rtfd"];
[spanel beginSheetForDirectory:NSHomeDirectory()
file:nil
modalForWindow:myWindow
modalDelegate:self
didEndSelector:@selector(didEndSaveSheet:returnCode:conextInfo:)
contextInfo:NULL];
}

-(void)didEndSaveSheet:(NSSavePanel *)savePanel returnCode:(int)returnCode conextInfo:(void *)contextInfo
{
if (returnCode == NSOKButton){
NSLog([savePanel filename]);
}else{
NSLog(@"Cansel");
}
}
@end
-------------------------------------------

-Tyson


On Saturday, July 26, 2003, at 08:11 PM, email@hidden wrote:

Date: Sat, 26 Jul 2003 15:47:40 -0700
Subject: NSSavePanel Example
From: Tyson Tate <email@hidden>
To: email@hidden

Can anyone refer me to a clear example of using an NSSavePanel as a
sheet. I had one working as a modal just fine but after I've tried to
convert it to a sheet, it opens the sheet but wont let me choose any
directories and when I change the document name, it starts spitting
errors to the console:

exception: *** -[NSCFArray objectAtIndex:]: index (4) beyond bounds (0)
2003-07-26 15:44:55.901 PDF417Man[13597] Exception raised during
posting of notification. Ignored.

Thanks!

--
Tyson Tate, Editor
Entropy Magazine
"Nourishment For The Starved."
http://www.entropymag.net

--
Tyson Tate, Editor
Entropy Magazine
"Nourishment For The Starved."
http://www.entropymag.net
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: not getting window delegate messages
  • Next by Date: Making two frameworks related but non-dependant
  • Previous by thread: NSSavePanel Example
  • Next by thread: MP3 info?
  • Index(es):
    • Date
    • Thread