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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:27:01+00:00 2026-06-08T12:27:01+00:00

I’m a starting iOS developer and I would like to get the idea of

  • 0

I’m a starting iOS developer and I would like to get the idea of NSMutableArray.
Specifically, I want to pass NSString value from one VC to NSMutableArray, belonging to another view controller. I also want that NSMutableArray to populate UITableView on its view. Any ideas how to do this?
For example, I have this action that the user triggers from within 1st view

- (IBAction)addToFav:(id)sender {  
}

And I want to pass a value of NSString myBookString to the NSMutableArray array in the 2nd view.
The task is fairly simple, but I can’t quite understand why you can’t pass the values to NSMutableArray outside this - (void)insertObject:(id)anObject atIndex:(NSUInteger)index method mentioned in Apple’s reference docs.
Thanks in advance!

EDIT: My views are different VC belonging to UITabBar and to UINavigationController at the same time

  • 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-08T12:27:02+00:00Added an answer on June 8, 2026 at 12:27 pm

    You need a communication between two controllers. There are several solutions. Pick one of the following. I recommend delegate.

    From http://www.hollance.com/

    When you have two objects A and B, say two view controllers, that you want to make talk to each other, you can choose from the following options:

    NSNotificationCenter.

    • This is anonymous one-to-many communication. Object A posts a notification to the NSNotificationCenter, which then distributes it to any other objects listening for that notification, including Object B. A and B do not have to know anything about each other, so this is a very loose coupling. Maybe a little too loose…

    KVO (Key-Value Observing).

    • One object observes the properties of another. This is a very tight
      coupling, because Object B is now peeking directly into Object A. The
      advantage of KVO is that Object A doesn’t have to be aware of this at
      all, and therefore does not need to send out any notifications — the
      KVO mechanism takes care of this behind the scenes.

    Direct pointers.

    • Object A has a pointer to Object B and directly sends it messages
      when something of interest happens. This is the tightest coupling
      possible because A and B cannot function without each other. In the
      case of view controllers you generally want to avoid this.

    Delegates

    • Object B is a delegate of Object A. In this scenario, Object A does
      not know anything about Object B. It just knows that some object
      performs the role of its delegate and it will happily send messages
      to that delegate, but it doesn’t know — or care — that this is Object
      B. The delegate pattern is often the preferred way to communicate
      between view controllers, but it takes some work to set up.

    Blocks.

    • Essentially the same approach as delegates, except that Object B now
      gives Object A one or more blocks (closures) to be executed when
      certain events take place. There is no formal delegate protocol and
      the only thing that Object A sees of Object B is the blocks it is
      given.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I would like to run a str_replace or preg_replace which looks for certain words
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I've got a string that has curly quotes in it. I'd like to replace
Specifically, suppose I start with the string string =hello \'i am \' me And
I have a French site that I want to parse, but am running into

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.