How to enable FinderSync Extension in the System Preference in Cocoa - Objective C -


i integrating findersync extension in cocoa application show badges in files , folders. @ below 2 scenario:

1) when run application using findersync extension (like demofindersync) @ blue popup in below image, in case extension added in system preference check mark , called principal class "findersync.m" well.

screen shot 1

2) when run application using application scheme (like demoapp) @ blue popup in below image, in case extension added in system preference without check mark , principal class "findersync.m" not call , findersync extension not work in case.

screen shot 2

so have idea how enable finder extension in system preference using second scenario.

any appreciated..!!

non-debug scheme (#if !debug):

    system("pluginkit -e use -i com.domain.my-finder-extension"); 

when running under debugger give path extension directly:

    nsstring *pluginpath = [[[nsbundle mainbundle] builtinpluginspath] stringbyappendingpathcomponent:@"my finder extension.appex"]; nsstring *pluginkitstring = [nsstring stringwithformat:@"pluginkit -e use -a \"%@\"", pluginpath]; system([pluginkitstring cstringusingencoding:nsutf8stringencoding]); 

specify in applicationdidfinishlaunching method. should manually turn on once if user turned extension off in system preferences don't turn on every time application starts. set nsuserdefaults key first time user launches app has finder sync extension support.


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -