There was some discussion of this on stack overflow but one of the APIs there 
is deprecated: LSSharedFileListItemResolve.
It’s 3rd parameter takes a pointer to a CFURLRef and that is now deprecated.

Instead, use LSSharedFileListItemCopyResolveURL; basically the return value 
from this is what you want.

Deprecated:
        if( LSSharedFileListItemResolve( itemRef , 0 , (CFURLRef*) &thePath , 
NULL ) == NoErr )

Accepted:
        thePath = LSSharedFileListItemCopyResolveURL( itemRef, 0 , NULL)
        if( thePath ) 

It looks to me like this was done to have a single API for both Swift and Obj-C 
for less maintenance (makes sense).


> On Apr 19, 2016, at 2:01 PM, Jens Alfke <j...@mooseyard.com> wrote:
> 
> One of my companies’ apps has a “Launch at login” pref, which no longer works 
> in OS X 10.11. I’m not surprised, since the existing code implements this by 
> writing into loginwindow’s user defaults :-p
> 
> I’m trying to find the currently supported API for this. The “Adding Login 
> Items” page says:
>> There are two ways to add a login item: using the Service Management 
>> framework, and using a shared file list.
>> Login items installed using the Service Management framework are not visible 
>> in System Preferences and can only be removed by the application that 
>> installed them.
>> Login items installed using a shared file list are visible in System 
>> Preferences; users have direct control over them. 
> 
> I’d definitely prefer the latter, since it seems like a bad idea to have the 
> app not show up in the user’s login-item list in the Accounts system pref.
> 
> I found LSSharedFileList.h, but everything in there is marked deprecated. :(
> 
> What are my options?
> 
> —Jens
> _______________________________________________
> 
> 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/jeff%40szuhay.org
> 
> This email sent to j...@szuhay.org


_______________________________________________

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