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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:22:06+00:00 2026-06-03T23:22:06+00:00

I have a mutable array of values used in a tableviewcontroller, a mapviewcontroller, and

  • 0

I have a mutable array of values used in a tableviewcontroller, a mapviewcontroller, and the callingviewcontroller. I have been updating them all, ie.

[dataArray addObject:object atIndex:0];
[tvc. dataArray addObject:object atIndex:0];
[mvc. dataArray addObject:object atIndex:0];

Is there a way of declaring dataArray in the table and map viewcontrollers that would make them pointers to the dataArray in the callingViewController? So I would just have to update one?

***Okay guys, I made a really stupid mistake here. At some point I changed the initialization and passed nil as the dataArray, and for some reason I had an “if (!dataArray) create new” clause to hide it from myself.

Kaan is correct.
[dataArray addObject:object atIndex:0];
is all that is needed.

  • 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-03T23:22:07+00:00Added an answer on June 3, 2026 at 11:22 pm

    After your comment:

    How about you declare a property called dataArray in both your tableView and mapView and also callingView. Then, in your callingViewController, you initialize a mutable array called lets say myFirstArray and do:

    NSMutableArray *myFirstArray = [NSMutableArray array];
    self.dataArray = myFirstArray;
    myTableView.dataArray = myFirstArray;
    myMapView.dataArray = myFirstArray;
    

    This way they will both be pointing to the same object and change you do in one will reflect in the other. Give it a try!

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

Sidebar

Related Questions

I have an mutable array of say 20 objects. And it has values like
I have mutable string array named arrayout. It is having 3 element .Now I
I have a mutable array that is retained and storing several objects. At some
If I have a mutable array codes in an NSMutableDictionary categorize NSMutableArray *myMutableArray=(NSMutableArray*)[categorize objectForKey:@codes];
I have a sorted mutable array of a class called Topic. The topics represent
I have a one-time need to create a file from an iOS mutable array.
I have a UITableView that was created from data coming from a mutable array.
I am trying a simple application where I have a mutable array of mutable
I have the data into the mutable array and the value of array is,
I have an object that act on UserDefaults. It adds things into an Array

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.