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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:35:32+00:00 2026-05-13T06:35:32+00:00

This line of code: [mymutabledict setObject:myclassobj forKey:myclassobj.myidstring]; Is giving this error: *** -[NSCFString hash]:

  • 0

This line of code:
[mymutabledict setObject:myclassobj forKey:myclassobj.myidstring];

Is giving this error:

*** -[NSCFString hash]: message sent to deallocated instance 0x3c14610

I put in a breakpoint on that line and I’ve checked and all 3 objects (mymutabledict, myclassobj, and myclassobj.myidstring) are correctly allocated and visible and correctly there in the debugger. What else could be causing this error? Could it be something to do with the object or keys I used to put previous items into the dictionary?

I’ve even checked and the key used does not match any of the previously entered keys.

For a little extra info: I’m loading objects from an SQL database to a mutable dictionary in memory. This code has all worked fine on several sets of sample data for weeks and just today this came up with one specific copy of the DB. Thanks!

  • 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-13T06:35:33+00:00Added an answer on May 13, 2026 at 6:35 am

    You seem to be calling release too many times on something. Add the following code just above that line:

    for (NSString *key in mymutabledict) {
        NSLog(@"Key %@ maps to %@.", key, [mymutabledict objectForKey:key]);
    }
    NSLog(@"About to add %@", myclassobj);
    NSLog(@"   with key %@", myclassobj.myname);
    

    … and look for the crashing object.

    Keys are copied, not retained, when objects are added to an NSDictionary / NSMutableDicitonary object. If you’re pulling the keys from the dictionary and releasing them (e.g., calling [key release] in the above code or on string objects acquired via [mymutabledict allKeys]), that might do it.

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

Sidebar

Related Questions

i use this line of code : [self parseXMLFileAtURL:url]; And i get this error
For some reason this line of code is giving me quite a problem. struct
I have this line of code but it throws an error. What is the
In this line of code <% var tmp = int.Parse(ViewData[numOfGroups].ToString()); %> I have error:
How come this line of code mine shows an error of var searchUser =
This line of code is generating an error: Accessing unknown 'zPosition' component of a
At this line of code i am getting the error as i mentioned I
This line of code if (sqlite3_open(([databasePath UTF8String], &database) == SQLITE_OK) generates an error saying
This line of code: DateTime dt = DateTime.ParseExact(time, hh:mm, CultureInfo.InvariantCulture); parses a time value
This line of code ((Matches)Container.DataItem).MatchID works in C# but in VB.NET, when used in

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.