Hi All,
In my application I need to choose only dmg files, so I am using
NSOpenPanel with the following code snippet.
But the NSOpenPanel is also allowing me to choose the folders having
the extension '.dmg'.

Ideally NSOpenPanel should allow me to choose only dmg files not
folders ? Is this behavior as designed ?
----------------------
    NSOpenPanel *op = [NSOpenPanel openPanel];
    [op setCanChooseFiles:YES];
    [op setCanChooseDirectories:NO];
    NSInteger val = [op runModalForDirectory:@"/" file:nil
types:[NSArray arrayWithObject:@"dmg"]];
    if( val ==  NSOKButton )
    {
      NSArray *filesToOpen = [op filenames];
      NSLog(@"%@", filesToOpen );
    }
----------------------

Please suggest the right way to disallow the folder selection in this
case such that the open button remains disable for all the folders.

Thanks,
Sachin
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please 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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to