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

  • Home
  • SEARCH
  • 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 7399027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:00:17+00:00 2026-05-29T04:00:17+00:00

I have the following problem: I created a iOS 5 SDK application with Storyboard

  • 0

I have the following problem:
I created a iOS 5 SDK application with Storyboard that contains a TabBar and three ViewControllers.
From another Class (Receiver.m) I want to access a UI Label on e.g. ThirdViewController.m which is one of the thee ViewControllers of the TabBar.

In ThirdViewController.h i got

@interface ThirdViewController : UIViewController {
}
@property (weak, nonatomic) IBOutlet UILabel *textlabel1;
@end

and in ThirdViewController.h:

@implementation ThirdViewController
@synthesize textlabel1;
...

This seems OK, since i can set the label properties from within the ThirdViewController instance.
Now to get access from within Receiver.m I use:

   UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:[NSBundle mainBundle]];
   ThirdViewController *myVC = [storyboard instantiateViewControllerWithIdentifier:@"ThirdViewController"];
   myVC.textlabel1.text = @"Hello"; 

This does not work. I do not want to create a new instance of ThirdViewController but access the existing one to update just the UILabel. My Storyboard in Project Navigator is default named MainStoryboard.storyboard .
Am I doing something wrong here with getting the ThirdViewController classes instance?

The error says:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 
'Storyboard (<UIStoryboard: 0x190590>) doesn't contain a view controller with 
identifier 'ThirdViewController''

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-29T04:00:18+00:00Added an answer on May 29, 2026 at 4:00 am

    Storyboard doesn’t give you a way to access the already presented version of a view controller – as you’ve found, the method you are using creates a new instance.

    I would question the structure of your code if you are expecting an external object to update a specific label belonging to a view controller. This is not a typical design pattern as it makes a tight dependency between the two objects. Usually you would set your view controller to be the delegate of your Receiver object (if it is created by that view controller), or your receiver object would send a notification that your third view controller is listening for.

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

Sidebar

Related Questions

I have following problem. I have created a tab based Application with three Views
I have following problem: I have built a tabbar application with 4 tabs. I
I have the following problem: i have some data loaded in my application, that
I have the following problem in application express which is driving me crazy: I
I have a following problem. I have a ListView which returns data from SQL
I still have following problem EXPLAIN EXTENDED SELECT `item`.`id`, `item`.`timestamp`, `item`.`label` FROM item WHERE
I have the following problem: Multithreaded WPF application, Model View Presenter Implementation. Presenters and
I'm having the following problem. I created a application context file for spring.net. The
I have created an empty project (XCode 4.2 IOS SDK 5), I have added
I have the following problem: I created content type movies and content type actors.

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.