It sounds like you're saying you want to run multiple instances of your cocoa application at the same time. Typically, cocoa applications do not allow you to run multiple instances at the same time, so you will not need to perform this check. Is there any particular circumstance in which you find that the cocoa application is starting at the same time?
All in all, cocoa's way to solve this look at running applications in NSWorkspace. This returns an NSArray containing a dictionary for each running application. You can go through the array to find out if the application you are looking for is working. I would advise using the value with the NSApplicationBundleIdentifier key, which will have a value, for example, "com.mycompany.myapp", and not look for the name. If you need to find the package identifier for the application, you can look at its info.plist file in the application package.
source share