Info.plist and bindings

19 views
Skip to first unread message

Eimantas Vaičiūnas

unread,
Sep 21, 2010, 1:02:45 PM9/21/10
to cocoa-...@googlegroups.com
Hi list!

I'd like to bind certain Info.plist value to a checkbox in my app's
preferences. What's the common approach to doing this? Or is it not
recommended for some reason?

All the best,
Eimantas

Jim Dovey

unread,
Sep 21, 2010, 1:08:04 PM9/21/10
to cocoa-...@googlegroups.com
Not recommended. Changing your info plist inside the app invalidates
your code signature, and you should be code signing your app.

Sent from my iPhone

Eimantas Vaičiūnas

unread,
Sep 21, 2010, 1:23:49 PM9/21/10
to cocoa-...@googlegroups.com
On Tue, Sep 21, 2010 at 8:08 PM, Jim Dovey <jimd...@gmail.com> wrote:
> Not recommended. Changing your info plist inside the app invalidates
> your code signature, and you should be code signing your app.
>
> Sent from my iPhone
How does one handle the "App is an agent" setting. Usually found as
"Display app in dock" setting in preferences.

// E.

Paul

unread,
Sep 21, 2010, 4:46:41 PM9/21/10
to cocoa-...@googlegroups.com
On Tue, Sep 21, 2010 at 10:23 AM, Eimantas Vaičiūnas <enc....@gmail.com> wrote:

How does one handle the "App is an agent" setting. Usually found as
"Display app in dock" setting in preferences.


Declare yourself as an NSUIElement / LSUIElement / LSBackgroundOnly in the Info.plist, and then promote your app with either -[NSApplication setActivationPolicy:NSApplicationActivationPolicyRegular] or TransformProcessType(). You can transition from a UI element / background app to a full-blown GUI app with a dock icon, but not the other way around. Once you have a Dock icon, you're stuck.

See these documents for more details:


Like others said, don't modify your Info.plist. It will break your code signature, and in some cases you won't have write access either.

  - Paul

Eimantas Vaičiūnas

unread,
Sep 22, 2010, 4:51:13 AM9/22/10
to cocoa-...@googlegroups.com
On Tue, Sep 21, 2010 at 11:46 PM, Paul <shado...@gmail.com> wrote:
> On Tue, Sep 21, 2010 at 10:23 AM, Eimantas Vaičiūnas <enc....@gmail.com>
> wrote:
>>
>> How does one handle the "App is an agent" setting. Usually found as
>> "Display app in dock" setting in preferences.
>>
>
> Declare yourself as an NSUIElement / LSUIElement / LSBackgroundOnly in the
> Info.plist, and then promote your app with either -[NSApplication
> setActivationPolicy:NSApplicationActivationPolicyRegular] or
> TransformProcessType(). You can transition from a UI element / background
> app to a full-blown GUI app with a dock icon, but not the other way around.
> Once you have a Dock icon, you're stuck.
Stuck as in going back to background mode requires app restart or just
"stuck" stuck?

Thanks a lot! I will try these.

// E.

Paul Marks

unread,
Sep 22, 2010, 5:22:43 AM9/22/10
to cocoa-...@googlegroups.com

On Sep 22, 2010, at 1:51 AM, Eimantas Vaičiūnas wrote:

> On Tue, Sep 21, 2010 at 11:46 PM, Paul <shado...@gmail.com> wrote:
>> On Tue, Sep 21, 2010 at 10:23 AM, Eimantas Vaičiūnas <enc....@gmail.com>
>> wrote:
>>>
>>> How does one handle the "App is an agent" setting. Usually found as
>>> "Display app in dock" setting in preferences.
>>>
>>
>> Declare yourself as an NSUIElement / LSUIElement / LSBackgroundOnly in the
>> Info.plist, and then promote your app with either -[NSApplication
>> setActivationPolicy:NSApplicationActivationPolicyRegular] or
>> TransformProcessType(). You can transition from a UI element / background
>> app to a full-blown GUI app with a dock icon, but not the other way around.
>> Once you have a Dock icon, you're stuck.
> Stuck as in going back to background mode requires app restart or just
> "stuck" stuck?

As the documentation states, they're one-way transforms. The only way to become a background app again is to relaunch. So I meant you're "stuck" in the foreground state once you make the transition.

- Paul

Eimantas Vaičiūnas

unread,
Sep 22, 2010, 6:25:28 AM9/22/10
to cocoa-...@googlegroups.com
On Wed, Sep 22, 2010 at 12:22 PM, Paul Marks <shado...@gmail.com> wrote:
> As the documentation states, they're one-way transforms. The only way to become a background app again is to relaunch. So I meant you're "stuck" in the foreground state once you make the transition.
Thanks for the clarification!

// E.

Reply all
Reply to author
Forward
0 new messages