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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:39:47+00:00 2026-05-21T22:39:47+00:00

If I have a data tree that is something like : NSMutableDictionary (dict1) NSMutableDictionary

  • 0

If I have a data tree that is something like :

NSMutableDictionary (dict1)
   NSMutableDictionary (dict2)
      NSMutableArray (array)
        NSMutableDictionary (dict3)
           Key1
           Key2

        NSMutableDictionary (dict_n)
           Keyn
           Keyn

   NSMutableDictionary (dict_n)
      NSMutableArray (array_n)
        NSMutableDictionary (dict_n)
           Keyn
           Keyn

        NSMutableDictionary (dict_n)
           Keyn
           Keyn

If I want to change the value of Key1, is there a simplier way than…

getting dict1
then getting dict2
then getting array
then getting dict3

converting dict3 to a mutable Dictionary
then setting key1

Converting array to a mutable array
then setting dict3 into array

converting dict2 to a mutable Dictionary
then setting array into dict2

converting dict1 to a mutable Dictionary
then setting dict2 into dict1

Doing that for each value I have to change is a real headache, and really code consuming.

  • 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-21T22:39:48+00:00Added an answer on May 21, 2026 at 10:39 pm

    You can’t send a message to an object unless you have a pointer to that object, so in a basic sense the answer to your question is no, there’s no other way.

    However, one presumes that this data structure that you have represents some sort of data model. As such, it should probably be contained in some sort of model class that understands its parts, and that class should be the only one that needs to understand how the data is stored. The model class should offer a higher-level interface to the data. Say dict3 represents one particular vehicle in a fleet, and the keys are things like “vehicleTag”, “registrationDate”, “purchaseDate”, etc. Maybe the dictionaries at the dict2 level the fleets in different regions, and dict2 itself represents the northeast fleet. Then the VehiclePool class, your model class which stores all the data, might offer methods like:

    -registrationDateForVehicle:(int)vehicleIndex inFleet:(NSString*)fleetKey;
    -setRegistrationDate:(NSDate*)regDate forVehicle:(int)vehicleIndex inFleet:(NSString*)fleetKey;
    

    I’m not sure I’d really want an API like that — I’d prefer to get the list of vehicles for a given fleet and then operate on those with simpler accessors, but you seem to want to avoid several levels of accessors. The point here is that you shouldn’t be writing a ton of code to do the operations you need; you should write methods that know how to access the data and then call those.

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

Sidebar

Related Questions

I am trying to have a tree display custom data that looks like this.
I have a data-structure (in plist) that looks something like this: What i have
I have a tree of data that I would like to present to the
I have a hypothetical tree view that contains this data: RootNode Leaf vein SecondRoot
I have data in a python dictionary that I'd like to store in a
I want to have a map that permits a tree-like behaviour. I want to
I have a RuleTree data structure which represents a tree of rules that are
I am writing an entity that has a tree like data structure. I am
Let's say that I have an adt representing some kind of tree structure: data
I have a MySQL table with a tree data structure. The fields are _id

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.