Reputation: 138
I have an application that runs as an agent and has icon in the top bar. It should be able to run another app with window and icon in the dock. Both should to share same core data. Is there way to do it? How to open one app from another? Thank you.
Upvotes: 0
Views: 54
Reputation: 3017
Create a new cocoa application target, then add Copy Files
build phase that embeds your subproject target into main app bundle:
Launch your embedded binary with NSTask class with code like this:
NSString *executablesPath = [[[NSBundle mainBundle] executablePath] stringByDeletingLastPathComponent];
NSBundle *subProjBundle = [NSBundle bundleWithPath:[executablesPath stringByAppendingPathComponent:@"subproject.app"]];
NSTask *subBinaryTask = [[NSTask alloc] init];
subBinaryTask.launchPath = [subProjBundle executablePath];
[subBinaryTask launch];
Upvotes: 2