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

  • Home
  • SEARCH
  • 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 8408411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:37:29+00:00 2026-06-09T23:37:29+00:00

I set a breakpoint… if I do: (lldb) print [self dictionary] (NSDictionary *) $5

  • 0

I set a breakpoint…

if I do:

(lldb) print [self dictionary]
(NSDictionary *) $5 = 0x0945c760 1 key/value pair

but if I do:

(lldb) print [[self dictionary] allKeys]
error: no known method '-allKeys'; cast the message send to the method's return type
error: 1 errors parsing expression

Even if I try to access the key that I know is in there..

(lldb) print [[self dictionary] objectForKey:@"foobar"]
error: no known method '-objectForKey:'; cast the message send to the method's return     type
error: 1 errors parsing expression

What am I doing wrong?

  • 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-09T23:37:30+00:00Added an answer on June 9, 2026 at 11:37 pm
    error: no known method '-objectForKey:'; cast the message send to the method's return type
    

    So, it tells you it can’t deduce return type information merely from the name of the message send – and that’s perfectly fine. And it even tells you how exactly you have to resolve that problem – you have to cast the message send to the method’s return type.

    Firing up Apple’s docs, we find out that - [NSDictionary objectForKey:] returns id – the generic Objective-C object type. Casting to id (or even better, if you know what types of objects your dictionary holds, casting to that exact object type) does the trick:

    (lldb) print (MyObject *)[(NSDictionary *)[self dictionary] objectForKey:@"foobar"]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my custom model binder. I have my breakpoint set at BindModel but
I want to trace the source code , but when I set a breakpoint,
I had set breakpoint in source code but it will give me warning that
I've set a breakpoint in the following WebMethod but I'm never hitting the breakpoint.
I set a breakpoint but when I run my program it looks like it
I want to set a breakpoint on the __DoPostBack method, but it's a pain
I set a breakpoint, which worked fine. Is there a way to jump immediately
How can I set a breakpoint to a native library load event in Android?
Sometimes when I set a breakpoint and start debugging its color changes from red
If I open the script and set a breakpoint, it is ignored. In fact,

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.