Just looking on what I would use to only allow specific files to be selected (Images for now)
setFileTypesArray returns
NSOpenPanel may not respond to -setFileTypesArray:
and then the panel doesn’t open up at all. Heres my code:
NSArray * fileTypes = [NSArray arrayWithObjects:@"png",@"tiff",@"baz",nil];
NSLog(@"Button Pressed");
[textField setStringValue:@"Test"];
int i; // Loop counter.
NSOpenPanel* openDlg = [NSOpenPanel openPanel];
[openDlg setCanChooseFiles:YES];
[openDlg setFileTypesArray:fileTypes];
Thanks.
You’re looking for a delegate method from NSSaveOpenPanel’s delegate
Then, set your panel’s delegate to “self”, or wherever your define this method above.