Can you give us so more details? For example: What will the app do?
Your description is very strange, lol.

But indeed, you should create a normal cocoa app that do the stuff you want to do (UI + the real stuff), and a little daemon that checks every X minutes if the other app is running:
        yes: ok, continue
        no: start app (log message? App was stopped)

Jelle

On 31 May 2009, at 11:07, Alexander Spohr wrote:

Could you split your app in two?
One would be a daemon that runs all times, the second a gui-frontend for the deamon.

The problem seems to be that no one here can think of an app that has a gui that no one ever looks at. Why a gui at all if no one looks at it anyway?

        atze


Am 31.05.2009 um 08:18 schrieb Ammar Ibrahim:

But my app is a "normal" Cocoa App, it's not a daemon or an agent.

On Sun, May 31, 2009 at 6:16 AM, Chris Hanson <c...@me.com> wrote:

The best way to ensure your daemon or agent is always running is to have it
run via launchd.

Start by reading the launchd man page and the "Daemons and Agents" tech note; these will give you an overview of how Mac OS X used launchd to manage
these types of on-demand and always-on services.

-- Chris


On May 30, 2009, at 5:57 PM, Ammar Ibrahim <ammar.ibra...@gmail.com>
wrote:

On Sun, May 31, 2009 at 3:27 AM, Kyle Sluder <kyle.slu...@gmail.com>
wrote:

On Sat, May 30, 2009 at 5:20 PM, Ammar Ibrahim <ammar.ibra...@gmail.com >
wrote:

1- How do you ensure only one instance of your app is running? How do
you
detect if it stops responding? Can you restart it using something like a
watchdog? And how would you go about implementing it?


The system already does this for you.  Unless you're not writing a
regular application (say, a daemon or something), or you only want one instance regardless of how many people are logged in on the machine (say, using Fast User Switching). If you need to ask this question, you're probably not in either of these scenarios, so don't worry about
it.


Actually, I'm writing a non regular application, and it's for a controlled environment. No users will be using the system, it should be completely automated and recover from errors. All I need is to make sure my app is running at all times. Would a simple cronjob check do the trick? The only thing I dont know how to do at the moment is to check if the app is not
responding, and force quit it from an external script/app




2- Is there a way to launch applications like iTunes from cocoa without

the

need to use AppleScript?


Look at the NSWorkspace documentation. iTunes's bundle identifier is
com.apple.iTunes, but in general you can look at any app bundle's
Info.plist file to get its bundle identifier (the CFBundleIdentifier
key).




Thanks, I did and it did the trick. One question though, it seems the call returns before the app is launched, what's the best way to detect when the app is launched? I heard there's something called notification center or
so.
Is there a way to view all notifications being sent on my Mac?
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/cmh%40me.com

This email sent to c...@me.com


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/atze%40freeport.de

This email sent to a...@freeport.de

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/maillist%40codingmammoth.com

This email sent to maill...@codingmammoth.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to