Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reading NSUserDefaults from helper app in the sandbox

I found some resources on reading the NSUserDefaults of another application.

Objective-C NSUserDefaults caching prevents another app from accurately reading changes

NSUserDefaults: Is it possible to get userDefaults from another app?

Apparently, it's not possible. However the questions firstly relate to iOS, and secondly the two apps are completely different.

I have a LaunchAtLogin helper app. But it does some other tasks too. Therefore, the helper app should run always, but only start the main app if the BOOL in the NSUserDefaults is set.

Is there a way I can achieve that?

like image 394
IluTov Avatar asked Jan 15 '23 16:01

IluTov


1 Answers

Since 10.7.4 you can use Application Groups within the sandbox. All applications within the group share the same sandbox. See Application Groups on how to set these up.

like image 172
diederikh Avatar answered Jan 28 '23 02:01

diederikh