On Tue, May 29, 2012 at 10:52 AM, Mark Allan
<markjal...@blueyonder.co.uk> wrote:
> Hi all,
>
> I posted this to the developer forums yesterday but I think this list 
> probably gets a good bit more eyeball than the forum, so I'm sending here 
> too. Sorry for the cross-post if you're seeing it twice.  Anyway...
>
> I'm trying to put together the last bits and pieces of sandboxing my app but 
> I've just hit a problem.  I don't appear to be able to use launchctl to 
> schedule tasks any more.
>
> With my app sandboxed, I'm launching an NSTask with the following launch path 
> and arguments:
>> /bin/launchctl load -w /Users/mark/Library/Containers/<my app 
>> identifier>/Data/Library/LaunchAgents/<my app identifier>.helpername.plist
>
>
> I'm using the correct APIs to get the path and read/write the 
> helpername.plist file.  As per other command line tools I launch via NSTask, 
> launchctl is presumably inheriting the same entitlements as my main 
> application, but launchctl obviously needs to modify other files to which my 
> app normally wouldn't have access - namely:[...]

SMLoginItemSetEnabled can be a solution.

https://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLoginItems.html

_______________________________________________

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Reply via email to