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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:12:46+00:00 2026-05-20T03:12:46+00:00

I have an app with a tab bar. Each tab has its own view

  • 0

I have an app with a tab bar. Each tab has its own view controller. I also have a mutable array that each tab view controller should be able to access (get the ith element, add a new element, delete an element, etc). Right now, I’m doing an ugly hack, which is passing the array around as I change tabs with using things like this in the viewWillAppear and viewDidDisappear methods:

[[[[self.tabBarController viewControllers] objectAtIndex:2] viewControllers] objectAtIndex:0];

Please can someone enlighten me as to the correct way to do this? I have a feeling I should just keep the array in my appdelegate, but I’m not sure how to access it from the other view controllers if I do that.

Many 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-05-20T03:12:46+00:00Added an answer on May 20, 2026 at 3:12 am

    I’m facing a similar issue. After looking around I decided for a singleton which declares the NSMutableArray in its @interface, and then is shared between all the viewControllers.
    I started from this page for the general shape. I’m then passing around calls to set up the values of the array. I’m not still 100% done (see this post of mine) but I think this should be the way. Any other ideas are most than welcome!
    Have a nice day!
    /Luca

    • 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 has a tab bar, each tab contains a separate
I have an app that uses a tab bar controller. It has five tabs.
My iPhone app has a tab bar controller at the bottom of the view
I have a tab bar app that works. Each tab is a UINavigationController whose
My iPhone app is a Tab Bar Application, which has 5 tabs. In each
Setup: Tab Bar App First View is a ScrollView which has an ImageView as
I'm working on an iPhone app that has a UITabBar. Occasionally the tab bar
My app has two distincts modes. There's a tab bar controller in the app
I have an app with Tab Bar. Each Tab starts to request some data
I have a tab bar application and when I display a modal view controller,

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.