• 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
Opening/Saving files via Sheets...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Opening/Saving files via Sheets...


  • Subject: Opening/Saving files via Sheets...
  • From: Steven Canfield <email@hidden>
  • Date: Sat, 08 Dec 2001 16:20:52 -0600

#import "myDelagate.h"

@implementation myDelagate
- (IBAction)openPic:(NSWindow *)sender
{
NSArray *fileTypes = [NSArray arrayWithObjects: @"jpg", @"gif", @"tiff"
@"bmp", @"ping", @"pict", @"pdf", @"eps", nil];
NSWindow *myWindow;
myPanel = [NSOpenPanel beginSheetForDirectory:NSHomeDirectory()
file:nil
type:fileTypes
modalForWindow:myWindow
modalDelegate:self
didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:)
contextInfo:sender];
return FALSE;
}


- (void)openPanelDidEnd:(NSOpenPanel *)sheet returnCode:(int)returnCode
contextInfo:(void *)contextInfo{
{
NSArray *myArray;
if(returnCode == NSOKButton)
myArray = [myPanel filenames];
}
}



Ok, lets talk about this..
MyDelagate is just a NSObject, which I'm trying to use to control my window.
First of all, when I press the button "openPic" is hooked up to, I get this:

"2001-12-08 15:57:14.298 Nimage[744] *** +[NSOpenPanel
beginSheetForDirectory:file:type:modalForWindow:modalDelegate:didEndSelector
:contextInfo:]: selector not recognized"

(If there is one thing I dislike about Project Builder it is this..really
weird errors, that make no sense to me (though most compilers are the same
way))
In any case, I'd be much obliged if someone could help, since I've spent
over 4 hours trying to figure this out (but once I do, oh my, we'll be
set!)

My second question is can someone point me to a site where stuff like this
is covered, with examples? I have been looking at "Learning Cocoa" and
"cocoadevcentral.com" and Apple's site, and trying to piece it together from
the three of them...

Thanks in advance!


  • Follow-Ups:
    • Re: Opening/Saving files via Sheets...
      • From: John Hörnkvist <email@hidden>
  • Prev by Date: Re: monitoring file modifications
  • Next by Date: Re: Opening/Saving files via Sheets...
  • Previous by thread: PB error
  • Next by thread: Re: Opening/Saving files via Sheets...
  • Index(es):
    • Date
    • Thread