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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:26:25+00:00 2026-05-13T15:26:25+00:00

NSInvocation seems to be one of the worst designed functions in Cocoa, so I

  • 0

NSInvocation seems to be one of the worst designed functions in Cocoa, so I decided to check if anyone had written a recipe to make using it easier. I found a recipe on Matt Gallagher’s blog. Now to be able to do this he used some quite hackish techniques.

  1. Would you recommend using this code or is this technique too likely to lead to a hard to debug error?
  2. If not, what would you recommend instead?
  • 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-13T15:26:25+00:00Added an answer on May 13, 2026 at 3:26 pm

    I have used this NSInvocation approach in a few shipping iPhone products and Mac products. It definitely employs a few strange techniques but it’s not a fragile hack by any means: it’s rock solid and about as fast as NSInvocation creation is likely to be.

    I did briefly have a retain count bug in the code (long since fixed) but it’s no harder to debug retain counts here than anywhere else.

    Of course, my opinion is completely biased.

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

Sidebar

Related Questions

I would like to create an NSInvocation object using a method that takes a
I'm using NSInvocation to get some method returns, and unfortunately I seem to have
I'm using NSInvocation as follows: In my init, I'm writing this in my viewDidLoad:
I'm making a dynamic call using NSInvocation: NSInvocation *lNSInvocation = [NSInvocation invocationWithMethodSignature: [lListener methodSignatureForSelector:lSelector]];
I'm looking for a way to make an NSInvocation invoke a specific IMP .
Has anyone ever had experience embedding a field editor (for a NSTextField) inside a
I need to check the return type of an NSInvocation to see if it
Code: NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature]; BOOL initial = YES; [invocation setArgument:&initial atIndex:2]; Question:
I added NSInvocation to a dictionary to execute some commands I need, but I
The title is pretty self explanatory. I am currently trying to make a cocos2d

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.