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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:44:53+00:00 2026-06-18T15:44:53+00:00

I want to have a NSMutableDictionary that will pull it’s data from the web,

  • 0

I want to have a NSMutableDictionary that will pull it’s data from the web, and will be available from any view controller in the app.

In other words, I should be able to get and set the info in that dictionary in any part of the app.

I’ve read several solutions to this, one being to create an .h file that will contain that dictionary, and then add that .h file to the .pch so it will be available anywhere.

And the second option was to create the dict in AppDelegate, however people said it’s a bad solution.

Please advise on the best way to do this. 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-06-18T15:44:54+00:00Added an answer on June 18, 2026 at 3:44 pm

    You can use singleton class for sharing the data
    Check this Singleton class

    MyManger.h

    #import <foundation/Foundation.h>
    
    @interface MyManager : NSObject {
    NSMutableDictionary *_dict
    }
    
    @property (nonatomic, retain) NSMutableDictionary *dict;
    
     + (id)sharedManager;  
    @end 
    

    MyManger.m

    #import "MyManager.h"
    
    static MyManager *sharedMyManager = nil;
    
     @implementation MyManager
    
     @synthesize dict = _dict;
    
    #pragma mark Singleton Methods  
    
    + (id)sharedManager {
     @synchronized(self) {
        if(sharedMyManager == nil)
          sharedMyManager = [[super allocWithZone:NULL] init];
     }
    return sharedMyManager;
    } 
    
    - (id)init {
       if (self = [super init]) {
      dict = [[NSMutableDictionary alloc] init];
       }
     return self;
    }   
    

    You can access your dictionary from everywhere like this

       [MyManager sharedManager].dict
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app that I want the user to be able to set
i want to remove some objects from a NSMutableDictionary after some Time. I have:
If I have a data tree that is something like : NSMutableDictionary (dict1) NSMutableDictionary
I have an NSMutableArray that is loaded into a table view. The data in
If I have multiple threads that might want to write to an NSMutableDictionary (i.e.
I have a plist file in my main app bundle that I want to
I want to have an insert tab button for my UITextView so that users
i have created NSMutableDictionary with 10 keys.Now i want to access NSMutableDictionary keys in
I'm stumped. I have an NSMutableDictionary w/ nested dictionaries that I am enumerating through
I have a two column NSTableView that I want to populate with entries grabbed

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.