This question already has answers here:
Getting the list of running applications ordered by last use
(4 answers)
Closed 3 years ago.
In Objective-C on macOS, the method [[NSWorkspace sharedWorkspace] runningApplications] can be used to get a list of the running applications on the system.
However, per Apple's documentation, the order of applications in the returned array is undefined.
I'd like to get a list of the running applications in the order in which they would appear if the user were to press Cmd+Tab; that is, in the "Z-order" of how recently each application was the frontmost application.
How can this be done?
I think the best you can do is key-value observe NSWorkspace.sharedWorkspace's frontmostApplication property over time and maintain the order of the list yourself. Of course, that only works for the apps which have been made frontmost since your app was launched. Other apps would continue to be unordered.
Related
This question already has answers here:
Detect when a volume is mounted on OS X
(4 answers)
Closed 8 years ago.
I'm very new when it comes to Mac OS development and have some experience with Objective C for iOS and need some help getting started on a new project. I need to create something that listens for a drive mount and then lists the files from the drive in a list on the app. Unfortunately, there seems to be very limited tutorials on the subject and I just need help getting this off the line.
I've heard limited things about NSWorkspace but haven't found any tutorials on how to use that.
Also, If it helps, I'm looking for a DICOM-specific filetype (.dcm).
You'll want to listen for the NSWorkspaceDidMountNotification notification, which is issued by the shared NSWorkspace's NSNotificationCenter.
This is pretty straightforward Cocoa stuff. These references may help:
Receiving Workspace Notifications
Notification Programming Topics
This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
Unable to create live tile inside Windows 8 application
is it possible to use live tiles inside a page? I know how to configure tiles for start menu, but I don't know how to obtain a similar effect inside my app. Thank you
You can use the LiveTile control that comes with Callisto.
You could create the effect within an application, but the specific mechanism used for the Start screen is not directly available within the context of an application.
From another post in StackOverflow, you may be able to reuse/port code from the Windows Phone 7 toolkit. There's a number of applications in the Windows Store as well (search for "tile") that provide interfaces for designing tiles, and some may have incorporated similar functionality.
Also from this post, looks like Telerik may have a solution.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Launch an app from within another (iPhone)
I have designed sample applications and installed in the iPhone.
First application has a button in it, and i would like to get invoked the second application when the button is pressed. I am surfing to see the feasibility of it, but not sure if i have missed it.
Could someone guide the direction?
You want to look at employing an URL scheme for your second application.
If you mean you want to start another application from yours, you have to use URL Schemes.
Just register a custom scheme on your other app and call such URL from the first one.
Here there is a tutorial that might help you:
http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-working-with-url-schemes/
You can use URL SCHEME, please see the tutorial
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Is there an Objective-C Interpreter for the Mac?
I'm doing lots of graphics programming for iOS using CGPaths + CALayers, etc. and previewing in the iPhone Simulator. All works fine but it is just so slow to view results - taking 20+ seconds each time to run the program in the Simulator - that tweaking and testing is getting very tedious (and it seems, alliterative).
Is there any sort of Objective-C tool which would enable me to enter lines of code and see results immediately?
It sounds like what you want is a way to vary some parameters of your drawing and see the results immediately without having to recompile. I don't know of any tools that do that, but you could do it yourself by making a system where you can set the parameters you want. For example, maybe some gesture brings up a view that has some sliders or text fields in it, and you can change the values, hit "OK" and it re-renders with the new values. It would only be in the debug version so users never see it. You'll probably have to roll your own in this case.
This question already has an answer here:
Closed 10 years ago.
Using Objective-C and the Cocoa API, how can I search the OSX System Dictionary definition of "dog" and retrieve the results so I can display them?
You can use the DictionaryServices framework to get definitions from the active system dictionaries as text (CFString), or to show a dictionary window with the definition.