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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:07:45+00:00 2026-06-01T08:07:45+00:00

Sorry, beginner here . . . So I create an NSMutableDictionary in my app

  • 0

Sorry, beginner here . . .

So I create an NSMutableDictionary in my app delegate when the application launches, and then later pass it on to a view controller, as it contains options for the VC like a background image, a url I want to parse, etc.

Anyway, i wrote a custom init method for the VC, initWithOptions, where I pass the dictionary on. I’m trying to use this dictionary later on in other methods – so I created a NSMutableDictionary property for my VC and am trying to store the passed options dictionary there. However, when I go to get the contents of that property in later methods, it returns null. If i access it from the init method, it works. heres some sample code:

-(id)initWithOptions:(NSMutableDictionary *)options {
self = [super init];
if (self) {
    // Custom initialization

    self.optionsDict = [[NSMutableDictionary alloc]initWithDictionary:options];
    NSLog(@"dictionary in init method %@",self.optionsDict);

that NSLog logs the contents of the dictionary, and it looks like its working. then later when I do this:

    - (void)viewDidLoad
{    
     SDJConnection *connection = [[SDJConnection alloc]init];
    self.dataArray = [connection getEventInfoWithURL:[self.optionsDict objectForKey:@"urlkey"]];
    NSLog(@"dictionary in connection contains: %@", [self.optionsDict objectForKey:@"urlkey"]);
    [_tableView reloadData];

the dictionary returns null. Ive tried adjusting the property attributes, and it didn’t work with either strong or retain. Any ideas??

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-01T08:07:46+00:00Added an answer on June 1, 2026 at 8:07 am

    This happens to me sometimes. You forgot to call [super viewDidLoad] so your properties will not be created. Your viewDidLoad will take the place of UIViewController’s viewDidLoad.

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

Sidebar

Related Questions

Sorry, a beginner's question: I have a very simple function in my Django application
first,sorry for my bad English!! i'm new here and i'm a beginner of android
First sorry I'm a big beginner. Would like to ask a more experienced developers
Sorry for my ignorance here, but when I hear the word webserver, I immediately
I am a complete beginner here. Can someone please post some Delphi code to
Beginner hobby programmer here. I'm used to running C in OSX compiling with GCC
Sorry i'm a beginner,from what i know there are number of varieties of libraries
I am a real beginner at this so sorry if I am makin awfull
I'm facing this problem as a CAKEPHP beginner, sorry if this is a very
I am a real n00b in developing iOS app. This is my first application

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.