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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:41:44+00:00 2026-05-31T13:41:44+00:00

In my application, I have two View Controllers – a UIViewController and UITableViewController. Now,

  • 0

In my application, I have two View Controllers – a UIViewController and UITableViewController.
Now, in my TableViewController implementation I need to retrieve some data from the UIViewController (a property – array). The array it’s synthesized, so what I’m actually doing is that in the implementation of the UITableViewController, I’m creating a instance of my UIViewController, an array, and just set the array to [myUIViewController getTheArray]. I know it won’t work this way, it’s just retrieving nil, but in my VC it’s actually full of data. I am stuck at this point, I could’ve tried with the performSegueWithIdentifier method, but these views are not directly connected via a segue to each other. They are embedded in a Tab Bar View, and my ViewController has absolutely nothing to do with my TableViewController.
Any idea on how to make this work properly?
Thanks.

@interface classA : UIViewController

@property (strong, nonatomic) Playlist* playlist;

-(Playlist*) getTheCurrentPlaylist;
@end

@implementation classA

@synthesize playlist = _playlist;
// add data to _playlist
-(Playlist*) getTheCurrentPlaylist{
return _playlist;
}
@end

now, to classB

@interface classB : UITableViewController
@property (strong ,nonatomic) Playlist* playlistTab;
@end

@implementation classB
@synthesize playlistTab = _playlistTab;

-(void) viewDidLoad{
[super viewDidLoad];
classA *cla = [[classA alloc] init];
// what has to be done here?
_playlistTab = [cla getTheCurrentPlaylist];
}

I hope this makes it clear.

  • 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-31T13:41:45+00:00Added an answer on May 31, 2026 at 1:41 pm

    I’m not a 100% sure I understand what you mean so please do comment if I misunderstood something. Also, I’m fairly new to iOS development myself.

    Ok, so you have a Tab bar controller with a UIViewController and a UITableViewController. Your implementation of a UIViewController has some data and your UITableViewController needs access to that data. You can’t just create a new classA. You need to refer to the instance of the classA that you created and put into the tab bar.

    One thing you can do is to have the AppDelegate be aware of the UIViewController (i.e. AppDelegate has a property that references the UIViewController. Then in you UITableViewController, you can do something like this to access the UIViewController:

    MyAppDelegate *appDel = (MyAppDelegate *)[[UIApplication sharedApplication] delegate];
    appDelegate.myUIViewController.playlist;
    

    Sounds like a real simple application so probably using something like Core Data might be overly complicated. Another way you can do above, is to have your instance of ClassA set a values of some singleton then have ClassB read from that. Or simply just create a property of your AppDelegate that gets written to by UIViewController and read from your table view.

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

Sidebar

Related Questions

I have two view controllers: MyParentViewController and MyChildViewController . The application starts with MyParent
I have a problem in uinavigationcontroller. In my application i have two view controllers
I have two view controller classes in my application delegate. I can change from
I have two threads in an Android application, one is the view thread, and
I have a small problem with UINavigationController animation between two view. My application build
hai all, in my iphone application i have a login view with two text
I have application in VB.net that have two different form (Form1 and Form2). Now
I have two application that need to talk to each other. App1 needs to
I have two views with their controllers. The application start with the FirstViewController .
I have two views. The User view has some text and a button. I

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.