How can I open files from my application? For example, they type a directory in a text box called "inputBox", and they click the open button to open the file.
thanks
Kevin
You can use the NSWorkspace class to open files.
It has several useful methods:
Opening files
– openFile: – openFile:withApplication: – openFile:fromImage:at:inView: – openFile:withApplication:andDeactivate: – openTempFile: – openURL:
Their descriptions are given in the docs at https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWorkspace_Class/index.html
, , , , , . Mac. , , Xcode.
- NSOpenPanel. , , , , .
, "inputBox", open, .
NSOpenPanel ? , , : URL ( ), .
, .
, ...
NSString *logFilePath=seedFileDirectory=[[NSString alloc]initWithFormat:@"%@/LOCAL FILE NAME ",NSHomeDirectory()];
, logFilePath, , ...
- (IBAction)viewFile:(id)sender { [[NSWorkspace sharedWorkspace] openFile:logFilePath];
}
!!!
Source: https://habr.com/ru/post/1715748/More articles:ASP.NET extensible grid view? - javascriptКак отключить привязку значений маршрута в ASP.NET MVC? - asp.net-mvcCompare 2 database schemas on Mysql - comparisonComparing C ++ with the LEDA Library - c ++Is there a cross-browser way to ignore opacity when using jquery clone ()? - javascriptIs a "domain object" any class that represents business rules? - terminologyПолучение XML файла из URL-адреса в объект NSData? - objective-cSmart Pointer Implementation - Dynamic Distribution Using Templates - c ++ServerControl vs UserControl - asp.netAdd Intellisense documentation to StructureMap - structuremapAll Articles