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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:07:28+00:00 2026-06-18T06:07:28+00:00

I need to recover method names dynamically, via reflection calls at runtime. But get

  • 0

I need to recover method names dynamically, via reflection calls at runtime. But get strange results for some.

My TestClass contains a method like:

- (void)testMethod6_NSRect:(NSRect)a1 int:(int)a2 int:(int)a3 bool:(Boolean)a4 {
    ...
}

When enumerating the above classes methods using class_copyMethodList() and fetching the method selectors via method_getName(), I get:

"testMethod6_NSRect:int:int:_Bool:" 

Thus, the selector was rewritten somehow (by gcc?) to make “_Bool” from “bool”. As far as I tested yet, this seems to be done only for a “bool” selector-part – if I change it to int:(int), as in:

- (void)testMethod1_int:(int)a1 int:(int)a2 int:(int)a3 int:(int)a4 {
    ...
}

I get the expected:

"testMethod1_int:int:int:int:"

Q:
Does anyone know the rules or a pointer to where I could find them for this “selector rewriting”, or am I missing something? Is this only done for “bool”?
I also need to know if this behavior is depending on the gcc-version, osx-version or runtime library version.

I am using (gcc –version):
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
on a (uname -a)
10.8.0 Darwin Kernel Version 10.8.0:

  • 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-18T06:07:30+00:00Added an answer on June 18, 2026 at 6:07 am

    The problem lies in an ugly piece of preprocessor magic in the C99 standard header <stdbool.h>:

    #define bool _Bool
    

    C99 defines a type named _Bool which behaves like C++’s bool type. The define is there to be able to use it in C but with the C++ identifier.

    Solution:

    #undef bool
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Need some help... I have jasperserver 4.1 installed on my ubuntu. It runs via
I have to dynamically instantiate certain class based on runtime configuration. So, I need
Need some regular expressions help. So far I have my code working to allow
Need to set some attributes of button. For example Checked. I guess it is
I'm using ANTLR3 with the C runtime. I'd like to do some custom error
I need to serialize some data in a binary format for efficiency (datalog where
In my javascript application(using prototype), I need some info from a third party server
I need to write some data in a temporary file and to store this
I need to recover two Git branches that I somehow deleted during a push.
we have a problem [cit.] I need to assign a callback dynamically within a

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.