Re: Problem with LSSharedFileListInsertItemURL() usage. (API in LaunchServices/LSSharedFileList.h)
Re: Problem with LSSharedFileListInsertItemURL() usage. (API in LaunchServices/LSSharedFileList.h)
- Subject: Re: Problem with LSSharedFileListInsertItemURL() usage. (API in LaunchServices/LSSharedFileList.h)
- From: Parimal Das <email@hidden>
- Date: Tue, 8 Sep 2009 11:08:37 +0530
The 'url' path is correct as it is adding my app to the login item list,
I suspect that, as i am calling this method in awakeFromNib: , dock is
getting created first and then the app is getting added in the login item
list.
Can you suggest some events, which can be called before app generates its
dock icon.
I tried with applicationWillFinishLaunching, but did not work for me.
Any insights??
-Parimal
On Mon, Sep 7, 2009 at 9:58 PM, Steven Degutis <email@hidden>wrote:
> Parimal,
> Your code looks complete and correct, so my only guess is that the
> variable url is not actually pointing to [[NSBundle mainBundle] bundleURL]
> which might explain it. (Then again, I've only ever dealt with manually
> adding my application to the Login Items programmatically in apps that had
> no Dock icon, and only used status bar items.)
>
> --
> Steven Degutis
> http://www.thoughtfultree.com/
> http://www.degutis.org/
>
>
> On Mon, Sep 7, 2009 at 6:10 AM, Parimal Das <email@hidden>wrote:
>
>> Hello all,
>>
>> I am trying to do the following- "when my app is used for the first
>> time - *'open
>> at login'* is selected by default". For that i am calling the code below
>> for
>> the app's first run.
>>
>> The code is working fine and my app is getting added in the login item
>> list,
>> But on ctrl+click on my apps dock icon, its failing to show 'open at
>> login'
>> as selected (tick mark)
>>
>> What i am missing here??
>> Please guide.
>>
>> *LSSharedFileListRef loginListRef = LSSharedFileListCreate(NULL,
>> kLSSharedFileListSessionLoginItems, NULL);
>> if (loginListRef) {
>> // Insert the item at the bottom of Login Items list.
>> LSSharedFileListItemRef loginItemRef =
>> LSSharedFileListInsertItemURL(loginListRef,
>>
>> kLSSharedFileListItemLast,
>>
>> NULL,
>>
>> NULL,
>>
>> (CFURLRef)url, // url is my app location
>>
>> NULL,
>>
>> NULL);
>>
>> if (loginItemRef) {
>> CFRelease(loginItemRef);
>> }
>>
>> CFRelease(loginListRef);
>> }*
>>
>>
>> Advance Thanks
>> -Parimal Das
>> _______________________________________________
>>
>> Cocoa-dev mailing list (email@hidden)
>>
>> 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:
>>
>>
>> This email sent to email@hidden
>>
>
>
>
>
--
--
Warm Regards,
Parimal Das
Webyog Softworks
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden