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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:36:54+00:00 2026-05-24T19:36:54+00:00

I keep seeing references to being able to execute code from the debugger, but

  • 0

I keep seeing references to being able to execute code from the debugger, but it never works for me. For example,

(gdb) po [NSNumber numberWithBool:NO]

gives me “No symbol “NSNumber” in current context.”. Is there a setting I need to change? As far as I know I have a completely normal, uncustomized copy of Xcode 4.0.2 (I’m still on Snow Leopard so can’t upgrade to 4.1).

Update – I tried it in 4.1 on my laptop – exactly the same error.

Update 2 – a friend figured out that if you add a method to any class in the project that returns an NSNumber then the above command works in GDB, even if the method is never called. Also it seems to be any and all class methods, not just NSNumber. Instance methods seem to work ok.

Can anyone explain what is going on here, and is this expected behavior or a bug?

BTW, if you are wondering why I would want to print that, the back story is here: http://objectivistc.tumblr.com/post/8992822737/a-chocking-mystery-po-nsnumber-numberwithbool-no

  • 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-24T19:36:55+00:00Added an answer on May 24, 2026 at 7:36 pm

    It looks like GDB optimises its symbol lookup table so that symbols that are not referenced in code are not loaded, which is why your friend in Update 2 was able to use NSNumber.

    One simple fix is to replace occurrences of class names with the corresponding NSClassFromString() calls, e.g. replace NSNumber with NSClassFromString(@"NSNumber"):

    po [NSClassFromString(@"NSNumber") numberWithBool:NO]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I keep seeing people say that exceptions are slow, but I never see any
I keep seeing this kind of code a lot in python setup.py files. from
I keep seeing code that does checks like this if (IsGood == false) {
I keep seeing what appears to be a memory leak - but I can't
I'm trying to learn about this feature of javascript I keep seeing in code,
When reading, I keep seeing references to what they call Business Objects . I've
I've been reading a couple books/online references about compiler theory, and keep seeing that
Reading some piece of code and I keep seeing this : public override bool
While trying to learn Unity , I keep seeing the following code for overriding
This is the example I keep seeing online as how to set cookies. require

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.