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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:13:12+00:00 2026-05-23T15:13:12+00:00

If you have one NSObject that you want two ViewControllers to be able to

  • 0

If you have one NSObject that you want two ViewControllers to be able to use, how do you know which ViewController is calling it so when you pass what ever data you are computing back, you pass it back to the correct ViewController.

  • 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-23T15:13:13+00:00Added an answer on May 23, 2026 at 3:13 pm

    If you want the returned data to change based on the caller, create a method in the object you are retrieving data from rather than directly accessing a property.

    In your NSObject, you could have a method that follows this format (my example is returning a string):

    - (NSString *)getDataFor:(NSInteger)callingController {
    
        NSString *outputString = nil;
    
        if (callingController == 1) {
            // set value of output string for controller 1
        } else if (callingController == 2) {
            // set value of output string for controller 2
        }
    
        return outputString;
    
    }
    

    Then, from your view controller, you just call the method with the appropriate identifier as input.

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

Sidebar

Related Questions

I have one drop down list in my page, which contains two options. What
I have use a singleton class that contained just one passed value. I then
I have a UIPopover that I want to use either -(BOOL)popoverControllerShouldDismissPopover:(UIPopoverController *)popoverController{ return NO;
I have two methods in my NSObject. I would like to know how to
I want to have one object that is initialized in the delegate and I
Hopefully this is an easy one... I have an NSObject with methods that is
have one time consuming step that flattens a bunch of files. basically i'd like
I have one XML request which I need to modify (to XML) and then
I have one table which contains events and dates, and another which contains the
I'm working on a navigation-based iPhone-only app that serves two main purposes: One, to

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.