Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8854849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:58:44+00:00 2026-06-14T13:58:44+00:00

UPDATE 1: Getting closer Someone on IRC mentioned that my NSPortName should be my

  • 0

UPDATE 1: Getting closer

Someone on IRC mentioned that my NSPortName should be my application, not Finder. I changed this and now I’m seeing a log message in my app when the context menu is selected:

Cannot find service provider for selector shareFile:userData:error: or shareFile:: for service shareFile

This seems odd considering I do have such an object registered.


I am trying to setup an NSService contextual menu for Finder to trigger my app on certain files.

The files have extension *.acxx and the action is simply to share. Note: I’ve changed all references of the bundle to be generic for this posting: com.mycompany.myproject.

My NSServices section of my infoPlist looks like this: (Note i have Document TYpes/UTIs setup for *.acxx as well)

<key>NSServices</key>
    <array>
        <dict>
            <key>NSRequiredContext</key>
            <dict>
                <key>NSTextContent</key>
                <array>
                    <string>URL</string>
                    <string>FilePath</string>
                </array>
            </dict>
            <key>NSSendFileTypes</key>
            <array>
                <string>com.mycompany.myproject.acxx</string>
            </array>
            <key>NSPortName</key>
            <string>Finder</string>
            <key>NSMessage</key>
            <string>shareFile</string>
            <key>NSMenuItem</key>
            <dict>
                <key>default</key>
                <string>Share with myproject</string>
            </dict>
        </dict>
    </array>

I have an object setup in my code that has the following method defined:

- (void)shareFile:(NSPasteboard*)pboard userData:(NSString*) error:(NSString**)err

And I register this elsewhere in my code:

// Register services
if (self.shareSvcMgr == nil)
{
    self.shareSvcMgr = [[ACAShareServiceManager alloc] init];
}
[NSApp setServicesProvider:self.shareSvcMgr];
NSUpdateDynamicServices();

Now, when I run the app and then make sure it’s registered with pbs, it looks fine:

/System/Library/CoreServices/pbs -debug en|grep -i myproj
        NSBundleIdentifier = "com.mycompany.myproject";
        NSBundlePath = "/Users/me/Library/Developer/Xcode/DerivedData/myproject-gihhiqhnzhwqbchflymzyafwxvws/Build/Products/Debug/myproject.app";
            default = "Share with myproject";
            "com.mycompany.myproject.acxx"

So when I go to the Finder and click on a *.acxx file, sure enough in Finder -> Services, my menu item Share with myproject shows up.

PROBLEM:

All is fine and dandy right? Well no. When I click ‘share with myproject’, nothing happens. I have a breakpoint setup in the shareFile method and the program is running and yet nothing happens, it never gets hit, etc.

I had read that I could debug the Finder using -NSDebugServices but I can’t seem to get that to work right. I’ve executed:

/System/Library/CoreServices/Finder.app/Contents/MacOS/Finder -NSDebugServices com.mycompany.myproject

This seems to start up a process but I get no Finder window to try to interact with.

I’m not sure where to go next. The idea of course is to pass the filename or file contents to my application when Share is sent and then I can do what is needed with it from there.

Are the SendFileTypes not setup right or something for this model? Any help appreciated. Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T13:58:45+00:00Added an answer on June 14, 2026 at 1:58 pm

    Alright. Someone on IRC pointed out that my method definition was missing something:

    - (void)shareFile:(NSPasteboard*)pboard userData:(NSString*) error:(NSString**)err
    

    It was missing a variable definition (which can totally mess up the selector matching). So it should have been this:

    - (void)shareFile:(NSPasteboard*)pboard userData:(NSString*)***udata*** error:(NSString**)err
    

    Once I changed that, the selector finally started getting called =)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Update: Ok, after getting past the fact that I did not have MSDTC set
UPDATE: I'm getting this error: (No route matches /docs/index.html... ) when accessing admin.example.com/docs/index.html The
UPDATE : Since this question is getting some views, I figured I'd better highlight
I have a hard time getting fragments to update their views... Specifically, fragments that
Update: This may not be Pairing. This may just need to have a service
I'm getting this error when trying to update a row in DB through stored
Update getting error when i try to call the method from Activity: SQLiteDatabase db
UPDATE: I tried implementing the method specified by Peter and am getting incorrect shadowing.
I'm getting error while using replace in an update statement in sql server 2008.
I am successfully getting Fluent NHibernate to update my database by calling UpdateBaseFiles: Public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.