문제

is it possible for the NSOpenPanel to show files with certain predefined attributes only, while all others are faded out?

I would like to show files for example the have certain creation or modification dates.

Thanks a lot!

도움이 되었습니까?

해결책

NSOpenPanel has a delegate protocol named NSOpenSavePanelDelegate.

And in there, you have the option of saying which files (returned as file URL's) are enabled. The one you'll want is "panel:shouldEnableURL:", which hands you a URL which you can open (within that delegate method) and look at the various file attributes such as creation or modification dates to decide which ones for which you can return YES ("yes", as in "yes this file can be selected for opening").

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top