In my app I want the user to either be able to click a button browse for a file or drag and drop it into the application and have it open the image. How can I do this? Which method would be easiest or do you recommend?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
use NSOpenPanel, and specify the allowed types
subclass NSDocument, and associate the document type with the image mime-type; this association is made in your app’s plist resource.
unless you have special needs, you can use CGImage and/or NSImage apis to open the image.