Objective C 内のディレクトリをウォークしようとしています。これは Java で実行できますが、Objective C でこれを行う方法がわかりません。私は XCode5 を使用しており、C++/C から離れようとしています。
私はいくつか持っていますが、これまでのところ、何かが欠けています。
- (IBAction)buttonPush:(id)sender {
NSLog(@"Button Pushed");
NSOpenPanel* panel = [NSOpenPanel openPanel];
[panel setCanChooseDirectories:YES];
// [panel setAllowsMultipleSelection:YES]; // not now
[panel setMessage:@"Select one or more, files or directories."];
[panel beginWithCompletionHandler:^(NSInteger result){
NSLog(@"OPEN Pushed");
if (result == NSFileHandlingPanelOKButton) {
NSArray* urls = [panel URLs];
[self parseArray:urls]; *// How do I use the URL?NSURL?
// Need to know if selected is File or Directory.
// If File, what is the file attributes
// If Directory, list the contents of the directory: procedure to recursively handle*
}