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 7406099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:30:15+00:00 2026-05-29T05:30:15+00:00

I am currently writing an app to use system services to import an image.

  • 0

I am currently writing an app to use system services to import an image.

I have followed all the steps from the Apple document about using services,

http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/SysServices/Articles/using.html#//apple_ref/doc/uid/20000854-CEGDDHJJ

but it didn’t work.

I have a NSViewController and put

"[NSApp registerServicesMenuSendTypes:returnTypes:...]"

in the “initialize” function, and overwrite these functions: 'validRequestorForSendType', 'readSelectionFromPasteboard', 'writeSelectionToPasteboard'.

The "registerServicesMenuSendTypes:returnTypes" was called after I start the app, but none of the others are invoked, nor the service menu changes.

Can anyone help me with this or give me a good example to look at?

Thanks a lot.

  • 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-05-29T05:30:16+00:00Added an answer on May 29, 2026 at 5:30 am

    Got the answer from apple: ( basicaly it would be more complicated to do this in the NSViewController, so I just implement it in a NSWindowController )

    =============================================================================

    Did your custom classes call -[NSApplication registerServicesMenuSendTypes:returnTypes:] early on in the application’s lifetime, like in their +initialize method?

    You say you’re expecting -validRequestorForSendType:returnType: to be called on your window and view controllers (rather than the windows or views, themselves). However, that’s not necessarily done. According to the documentation, that message is sent to the objects in the responder chain, plus NSApplication is documented as sending it to its delegate and NSWindow sends it to its delegate. It is important to note that a window controller is not necessarily the delegate of the window it controls. It can be. It may be common to set it up that way. But it is not automatically done by the framework. So, if you want the window controller to receive -validRequestorForSendType:returnType:, you need to make sure it’s is the window’s delegate.

    I see nothing that suggests NSView will forward that message to its controller. Certainly, a generic view doesn’t have a delegate. Even for those specific types of views that do have delegates (e.g. NSTabView), there’s no documentation that views send -validRequestorForSendType:returnType: to their delegates. So, if you want a view controller to receive -validRequestorForSendType:returnType:, you’ll have to ensure that it’s in the responder chain (or write a custom view subclass that specifically forwards that message to its controller).

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

Sidebar

Related Questions

I'm currently writing a Rails app, and hit a somewhat strange quirk. I have
I am currently writing my first Android app and have based most of my
For the current app I am writing I have elected to place all database
I have some user admin functionality in a WPF app that I'm currently writing
I'm currently writing an app in Python and need to provide localization for it.
I'm currently writing an app in Android that works with the GPS. At the
I'm currently writing a simple app that performs a series of requests to the
I am currently writing an Android app that, among other things, uses text information
I'm currently writing a Java app that interfaces with a MySQL database. My problem
My company is currently writing an iOS app whereby we will display some of

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.