Le 21 août 2009 à 09:08, Sutapalli Satyanarayana a écrit :

Hi,

I am using Cocoa with Obj C.
I am using the following method to open a file associated with a particular application.


[[NSWorkspace sharedWorkspace] openFile:<some file path>]

But if the file is associated with certain application, it is opening.

If the file is not associated with any application, I want the user to select the application also with which the file has to be opened. In the following code we have to tell which application it has to open. [[NSWorkspace sharedWorkspace] openFile:< some file path> withApplication:@"TextEdit"]

But I want user to select the application at run time dynamically.

--Satyam.


Use an NSOpenPanel to ask the user which application he want to use and pass the application full path to -[openFile:withApplication:]



_______________________________________________

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