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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:17:56+00:00 2026-06-13T04:17:56+00:00

I have a iOS single-view application for the iPad and using storyboards. I have

  • 0

I have a iOS single-view application for the iPad and using storyboards.

  • I have the default viewcontroller created by xcode (vc1). I
    place a button on its view.

  • I then drag a new view controller (screen2VC) onto the
    storyboard.

  • I also create a new view controller subclass (vc2SubClass)

  • I associate screen2VC to this subclass via the identity inspector.

  • On screen2VC’s view, I have a label. I control-drag the label onto
    vc2SubClass to create an outlet.

  • I create a segue between vc1’s button and vc2’s button.

  • In performSegue override i have the following code:

if ([segue.identifier isEqualToString:@"segue1"])
{
    screen2VC* vc = [segue destinationViewController];
    vc.label1.text = @"screen 2";
}

When I run the code and press the button, the segue works and transitions between the two views just fine, but screen2VC’s label is never set to ‘screen 2’. As a test, I placed the label1.text = @"screen 2"; code into vc2SubClass, but that made no difference. It seems there’s still no association between screen2VC and vc2SubClass, even though the former is subclassing the latter and the label is pointing to a UILabel outlet.

Any ideas?

  • 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-13T04:17:57+00:00Added an answer on June 13, 2026 at 4:17 am

    When you’re in performSegue: of vc1, vc2’s view hierarchy has not yet been set up. The normal way of doing this is to have a property in vc2 that temporarily is given the string during performSegue:. This property is then used to update the label in vc2’s viewWillAppear:.

    (When you say “As a test, i placed the ‘label1.text = @”screen 2″;’ code in vc2SubClass but that makes no difference” I’m not sure what’s going on there. What method was that code put into?)

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

Sidebar

Related Questions

I created an empty Single View application using Xcode 4.2 on OSX Lion 10.7.2
I have a single view application (created from the iOS Template, nothing special) There
I've made a new project as a Single View iOS Application in Xcode. I've
I am learning iOS. I m using Xcode 4.3.2 , and i have created
I have a single view on my iOS application, with a mapView in it.
I downloaded xcode 4 and created a single view application with storyboard. I added
In a Single-View iOS app I'm currently working on, I have a view controller
I have a single view in my application which does not receive any events
I have an application developed on iOS & Android using phonegap 1.6.0 & JQM
My iOS application draws into a bitmap (same size as my view) using Core

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.