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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:14:52+00:00 2026-05-24T09:14:52+00:00

In my AppDelegate, I download some data from the internet and store it into

  • 0

In my AppDelegate, I download some data from the internet and store it into an array. I want one of my ViewControllers to access that array. How would I go about in doing so? Is this a good situation to implement a delegate or a protocol? If so, can someone recommend a good tutorial for that?

Thank you

EDIT:

Please note that the data refreshes upon each launch so there is no need for Core Data or plists. Furthermore, the data are custom objects which I created so they can’t be stored in a plist for example.

  • 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-24T09:14:52+00:00Added an answer on May 24, 2026 at 9:14 am

    You have 2 options:

    1. Implement a delegate protocol
    2. Use NSNotifications

    The advantages/disadvantages of each is set out well in this question and answer:
    Delegates v Notifications

    As notifications are easier to implement and may well be sufficient for your needs, you can implement it with the following steps:

    1. In the class where you download the data:
      When the data has been downloaded and the array populated, include the following lines:

    NSDictionary *dict = [NSDictionary dictionaryWithObject:array forKey:@"Data"];
    [[NSNotificationCenter defaultCenter] postNotificationName:@"DataDownloaded" object:self userInfo:dict];

    1. In the class where you want to receive the data:

    2.1 Add the following line to your viewDidLoad method:

    `[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(dataDownloaded:) name:@"DataDownloaded" object:nil];
    

    2.2 Create the dataDownloaded selector:

    • (void)dataDownloaded:(NSNotification *)note {

      NSDictionary *dict = note.userInfo;
      NSArray *dataArray = [note.userInfo objectForKey:@"DataDownloaded"];

    2.3 Add the following line to dealloc and viewDidUnload:

    [[[NSNotificationCenter defaultCenter] removeObserver:self];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While reading cocoa tutorials i've noticed that some of the tutorials use AppDelegate and
I'm trying to access an NSMutableArray which is a data member of my AppDelegate
i have to write some code that initialize my data app. This must be
My app downloads data from internet when it starts, during the splash screen. It
I have a model which can download data from a server and thus an
I am trying to implement an application for iPhone that should simply download some
I have a Tableview on AppDelegate That calls a SecondView (dvController) when DidSelectRowAtIndexPath using:
I am currently writing an XML parser that parses a lot of data, with
I'm using an NSOperation to collect data that should be downloaded (takes 2-5 sec.)
I've downloaded the iOS CloudApp API files from the CloudApp website. I would like

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.