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

NSOpenPanel instantly closing


  • Subject: NSOpenPanel instantly closing
  • From: Nick Forge <email@hidden>
  • Date: Sun, 18 Feb 2007 14:30:41 +1100

I'm working through the cocoa-bible (Hillegass 2nd edition), and I'm doing the first exercise that makes use of NSOpenPanel (pg 241). Whenever I actually bring up the Open panel, it pops up, then almost instantly closes again, leaving the application hanging. Here is my code - I have re-written it twice to make sure I don't have any typos or anything like that. I do not understand what would be killing the panel before I even press anything... surely if I made some mistake it would either not come up in the first place, or it would die when I closed the panel?

- (IBAction)open:(id)sender
{
	NSOpenPanel *panel = [NSOpenPanel openPanel];

	// Run the open panel
	[panel beginSheetForDirectory:nil
							 file:nil
							types:[NSImage imageFileTypes]
				   modalForWindow:[stretchView window]
					modalDelegate:self
				   didEndSelector:
		@selector(openPanelDidEnd:returnCode:contextInfo:)
					  contextInfo:NULL];
}

Any ideas as to what might be causing it? I have put breakpoints both before and after the beginSheetForDirectory call, but that doesn't really help since it seems to screw up while executing that line.

Thanks,
Nick
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Follow-Ups:
    • Re: NSOpenPanel instantly closing
      • From: Andreas Mayer <email@hidden>
    • Re: NSOpenPanel instantly closing
      • From: Keith Duncan <email@hidden>
    • Re: NSOpenPanel instantly closing
      • From: email@hidden
    • Re: NSOpenPanel instantly closing
      • From: email@hidden
  • Prev by Date: Having a hard time...FSIsAliasFile
  • Next by Date: A Better way to get a path from NSImage?
  • Previous by thread: Re: Having a hard time...FSIsAliasFile
  • Next by thread: Re: NSOpenPanel instantly closing
  • Index(es):
    • Date
    • Thread