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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:48:11+00:00 2026-05-28T15:48:11+00:00

So, having a hard time dereferencing some data I’ve loaded into arrays and dictionaries:

  • 0

So, having a hard time dereferencing some data I’ve loaded into arrays and dictionaries:

Inside a controller:

- (void)setupVendorsArray {
    self.vendorsArray = [NSArray arrayWithObjects:@"Toyota", @"Honda",nil];
}

- (void)setupProductFamiliesHash {

    NSArray *lowcost = [NSArray arrayWithObjects:@"Corolla", @"Fit",nil];
    NSArray *midrange = [NSArray arrayWithObjects:@"Camry", @"Accord",nil];
    NSArray *highend = [NSArray arrayWithObjects:@"Lexus", @"Acura",nil];
    NSArray *trucks = [NSArray arrayWithObjects:@"Tacoma", @"Ridgeline",nil];

    NSDictionary *lc = [NSDictionary dictionaryWithObjects:lowcost forKeys:self.vendorsArray]; 
    NSDictionary *mr = [NSDictionary dictionaryWithObjects:midrange forKeys:self.vendorsArray]; 
    NSDictionary *he = [NSDictionary dictionaryWithObjects:highend forKeys:self.vendorsArray]; 
    NSDictionary *tk = [NSDictionary dictionaryWithObjects:trucks forKeys:self.vendorsArray]; 

    self.productFamiliesHash = [NSArray arrayWithObjects:lc,mr,he,tk,nil];
}

In gdb print-object results in this for productFamiliesHash:

(gdb) print-object self.productFamiliesHash
<__NSArrayI 0x6b2c760>(
{
    Toyota = "Corolla";
    Honda = "Fit";
},
{
    Toyota = "Camry";
    Honda = "Accord";
},
{
    Toyota = "Lexus";
    Honda = "Acura";
},
{
    Toyota = "Tacoma";
    Honda = "Ridgeline";
}
)

But, for the life of me I can’t seem to access, for example, Toyota Corolla, which I would expect I could do like this in gdb:

(gdb) p [[productFamiliesHash objectAtIndex:0] objectForKey:@"Toyota"]

However, gdb gives:

Unable to call function "objc_msgSend" at 0x156408c: no return type information available.

How do I dereference the dictionary within the array?

  • 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-28T15:48:12+00:00Added an answer on May 28, 2026 at 3:48 pm

    Try using po instead of p. For Objective-C methods, p requires that you cast the result:

    (gdb) p (id) [[productFamiliesHash objectAtIndex:0] objectForKey:@"Toyota"]
    

    Even then, you won’t get the description of the object, only the pointer value.

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

Sidebar

Related Questions

I am having hard time understanding typedef pattern for arrays. typedef char Char10[10]; void
I'm having hard time trying to figure out how to auto-save user data in
I'm having a hard time understanding and therefore managing arrays and indexes manually in
I'm having a hard time understanding some git/DCVS concepts. Here's what happened: I created
i am having hard time determining the length of a Decimal data type. The
I'm having hard time to find out how to read and write from /into
I'm having hard time with Xcode 4.2 (Build 4C199) changing some of my XIBs
I was reading this: http://johnsantic.com/comp/state.html and having hard time comprehending this part: void (*const
Hehe I'm having hard time on choosing the question title. But let me explain
I am having hard time in understanding Wait() , Pulse() , PulseAll() . Will

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.