Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old May 24, 2009, 03:23 AM   #1
lopoz
macrumors regular
 
Join Date: May 2005
Check NSOpenPanel selection before openSheetDidEnd

Hello,

I have an image viewer that opens directories and loads the pictures contained in them. What I'd like to do is check the contents of the directory for the presence of pictures, BEFORE the openSheetDidEnd selector is called, show the user an alert if the directory doesn't contain any images and have the user pick another directory.

How can I achieve this?

Thanks in advance for any advice!
lopoz is offline   0 Reply With Quote
Old May 24, 2009, 10:46 PM   #2
kainjow
Moderator emeritus
 
kainjow's Avatar
 
Join Date: Jun 2000
Setup a delegate on the open panel and implement panel:isValidFilename: - this will get called when the Open button is clicked. You can then return NO to force the user to select another file/folder.
kainjow is offline   0 Reply With Quote
Old May 25, 2009, 04:41 AM   #3
lopoz
Thread Starter
macrumors regular
 
Join Date: May 2005
Quote:
Originally Posted by kainjow View Post
Setup a delegate on the open panel and implement panel:isValidFilename: - this will get called when the Open button is clicked. You can then return NO to force the user to select another file/folder.
Thanks! I'll try that immediately!

And there I was trying to subclass NSOpenPanel.. It wasn't working out
lopoz is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
How to check log files to date/time system RAM was changed? Any way to check this? asterix2k10 OS X 1 Mar 7, 2014 08:19 PM
Selection problems robo44 iMac 3 Jan 31, 2014 06:07 AM
Resolved: NSOpenPanel Problem larswik Mac Programming 1 Dec 17, 2012 10:25 PM
The I may go to bed, and just check back in tomorrow to check my order status thread lsutigerfan1976 iPhone 0 Sep 14, 2012 10:50 PM
Check List++ (World most intuitive and fastest check list) - Free App appinitpro iPhone and iPod touch Apps 5 Jun 15, 2012 11:31 PM

Forum Jump

All times are GMT -5. The time now is 12:22 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC