Как получить доступ к общему контенту боковой панели Finder в какао

Я хочу получить доступ к общему содержимому левой боковой панели Finder в Mac, чтобы я мог получить системный список, подключенный к той же сети. Я могу получить доступ к избранному контенту, но мне не удалось получить доступ.

Я использую этот код для доступа к любимому контенту Finder.

UInt32 seed;
LSSharedFileListRef sflRef = LSSharedFileListCreate(NULL,
                                                    kLSSharedFileListFavoriteItems,
                                                    NULL);
CFArrayRef items = LSSharedFileListCopySnapshot( sflRef, &seed );
for( size_t i = 0; i < CFArrayGetCount(items); i++ )
{
    LSSharedFileListItemRef item = (LSSharedFileListItemRef)CFArrayGetValueAtIndex(items, i);
    if( !item )
        continue;
    CFURLRef outURL = NULL;
    LSSharedFileListItemResolve( item, kLSSharedFileListNoUserInteraction, (CFURLRef*) &outURL, NULL );
    if( !outURL )
        continue;
    //The actual path string of the item
    CFStringRef itemPath = CFURLCopyFileSystemPath(outURL,kCFURLPOSIXPathStyle);
    // TODO: Do whatever you want to do with your path here!!!!
    CFRelease(outURL);
    CFRelease(itemPath);
}
CFRelease(items);
CFRelease(sflRef);


Since i want to access systems available in shared network i change the key according to the key in the header file 

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.fram‌ ework / Headers / LSSharedFileList.h

But i get nothing for shared content.

Can anyone help me for accessing this.
Thanks for your time to help me in advance.

person Surjeet    schedule 31.07.2013    source источник
comment
Любая попытка кодирования?   -  person Raptor    schedule 31.07.2013
comment
да, я получаю избранный контент, используя информацию из stackoverflow.com/questions/10751199/, но любой ключ, доступный в файле заголовка /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSSharedFileList.h, не дает информация об общем контенте   -  person Surjeet    schedule 31.07.2013
comment
Покажите свои коды в вопросе, пожалуйста   -  person Raptor    schedule 31.07.2013


Ответы (1)


Вы можете использовать kLSSharedFileListRecentServerItems, чтобы получить недавно подключенные сетевые тома.

person Parag Bafna    schedule 09.08.2013