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

Re: beginSheetForDirectory problem


  • Subject: Re: beginSheetForDirectory problem
  • From: Gorazd Krosl <email@hidden>
  • Date: Mon, 31 May 2004 13:33:59 -0400 (EDT)

Koen,
your call to openPanel should be:
[openPanel beginSheetForDirectory:nil
file: nil
types:fileTypes //
defined earlier
modalForWindow: [self
window]
modalDelegate: self

// NOTE THE DIFFERENCE WITH YOUR CODE!!
didEndSelector:
@selector(openPanelDidEnd:returnCode:contextInfo:)
contextInfo: nil];

Your definition of selector is
@selector(openPanelDidEnd:), which is not the same
selector.

HTH
Gorazd

--- Koen van der Drift <email@hidden> wrote:
>
> Hi,

> I am trying to use a sheet to open a file, and have
> > added the following
> code to MyWindowController:


> NSOpenPanel *openPanel = [NSOpenPanel
openPanel];
> [openPanel beginSheetForDirectory:nil
> file: nil
> types:fileTypes >
// defined earlier
> modalForWindow:
[self window]
> modalDelegate: self
> didEndSelector:
> @selector(openPanelDidEnd:)
> contextInfo: nil];

> and:

> - (void)openPanelDidEnd:(NSOpenPanel *)sheet
returnCode:(int)returnCode
> contextInfo:(void *)contextInfo
> {
> if (returnCode == NSOKButton)
> {
> // get stuff from file
> }
> }


> The sheet opens, but when I dismiss it,
openPanelDidEnd never gets
> called.

> Anyone sees what I did wrong?

> thanks,

> - Koen.


______________________________________________________________________
Post your free ad now! http://personals.yahoo.ca
_______________________________________________
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: Code Guidelines
  • Next by Date: Re: Code Guidelines
  • Previous by thread: Re: beginSheetForDirectory problem
  • Next by thread: Re: NSSearchField Menu Enabling Troubles...
  • Index(es):
    • Date
    • Thread