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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:41:02+00:00 2026-06-10T09:41:02+00:00

Well I have those 2 variables, an NSString and an NSMutable Array which is

  • 0

Well I have those 2 variables, an NSString and an NSMutable Array which is value I want to be global in all my tabs. So far I had only one (the NSString) and I could get its value normally. No that I tried having one more variable I get (null) value.

here is my code:

AppDelegate.h

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;
@property (nonatomic,retain) NSString *myDate;
@property (nonatomic,copy) NSMutableArray *tracks_condition;

@end

and in the HomeView.m when i assign the values

AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
  parsed_date=[res objectForKey:@"date"];
    NSLog(@"Date:%@",parsed_date);
    delegate.myDate = parsed_date;
    NSString *parsed_track=[res objectForKey:@"Data1"];
    [delegate.tracks_condition addObject:parsed_track];
    NSLog(@"Track 0 Static:%@",parsed_track);
    NSLog(@"Track 0:%@",[delegate.tracks_condition objectAtIndex:0]);

parsed_date is being printed out normally and I can access it in aother tabs.

But I get:
Track 0 Static:0
Track 0: (null)

And i cannot understand why, as I add it as an object in the MutableArray. Of course i get (null) in every other tab.

Can you help me? i prefer by fixing that code and not suggesting something entirely different because I am not very experienced in IOS. Unless it is that easy.

  • 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-10T09:41:03+00:00Added an answer on June 10, 2026 at 9:41 am

    Most likely this is because you are never instantiating a mutable array for your tracks_condition property. Just declaring a property on your AppDelegate class doesn’t create the object for you. You still need to alloc/init the object at some point before you can use it. Until then tracks_condition remains null, and any messages sent to it (such as attempting to add an object to the array) will be ignored.

    You can fix this by instantiating an object and setting the value of your property before using it. You could do this in your app delegate’s application:didFinishLaunchingWithOptions:

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        self.tracks_condition = [[NSMutableArray alloc] init];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a DataTable which I select from database (Well, these data cross several
Well I have been writing in the same style for awhile now and all
I have few variables which are used system-wide in my rails app. It runs
I have a few strings which I need to translate and display. Those strings
Hello All, I have the following molten data: X variable value 1 StationA SAR11.cluster
I'm making a little java game in which I would have two threads (well
well i have a configuration like this in the components part of my config
Well i have a web page hosted in a IIS 7.0 now the problem
Well i have a div tag that i show as a modal dialog this
well I have that problem, im using a lightbox srcipt and im opening an

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.