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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:56:15+00:00 2026-06-14T06:56:15+00:00

Disclaimer: The program I wrote works. I just need help understanding it. Today I

  • 0

Disclaimer: The program I wrote works. I just need help understanding it.

Today I just started learning XCode and Objective-C. I have tons of experience with Java and I must admit this is very different. I’m currently following a book that has us dealing with two scenes in our story board. The Main View Controller Scene and the Flipside View Controller Scene.

In the main scene I have one label outlet that says Hello World. It’s name is label. In the flipside scene I have a text outlet. When the user flips from the flipside scene to the main scene the text in the text outlet is applied to the label outlet. So if I type in Hello StackOverflow in the flipside, and then flip it I will see Hello StackOverflow in the main scene.

We did this by going to the method that controls the flip and is in the main scene .m class and added this code.

self.label.text = controller.labelText.text;

Can anyone explain this code please? I understand that label and labelText are my names. And text is looking for the text. But I have no idea where self and controller came from and it is not explained in the book. Thank you.

EDIT

Here is the full code with the function that has controller in the function heading. I don’t get what is going on in this method. Any explanation would be great.

- (void)flipsideViewControllerDidFinish:(HWFlipsideViewController *)controller
{
    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
    {
        [self dismissViewControllerAnimated:YES completion:nil];
    }
    else
    {
        [self.flipsidePopoverController dismissPopoverAnimated:YES];
        self.flipsidePopoverController = nil;
    }

    self.label.text = controller.labelText.text;    
}
  • 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-14T06:56:16+00:00Added an answer on June 14, 2026 at 6:56 am

    self is the java this pointer and therefore points to your object

    text is a property and would be getText()

    so self.label.text is this.getLabel().getText() BUT
    as it sets text=something it is setText!

    => java-bean style getter and setter

    controller is likely a local variable.. PASSED to the method as an argument
    OR it is a member variable on the object of the this instance


    so it’d be

    this.getLabel().setText(controller.getLabelText().getText());
    

    this = the object you’re in and that the main view I think

    controller is the flipview

    the ‘overwrite’ is setting the String of our label to the Controller’s textfield string

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

Sidebar

Related Questions

I have an app that shows a disclaimer at the beginning of the program.
Disclaimer: I am a layperson currently learning to program. Never been part of a
Disclaimer: this question is driven by my personal curiosity more than an actual need
(DISCLAIMER: I'm not a programmer, I spend my time on serverfault, I'm just a
Disclaimer: Never used php in my life. New to Unix and Jenkins I have
Disclaimer: I'm not actually trying to make one I'm just curious as to how
Disclaimer: it's just another task for beginner so I'm good with the fact that
DISCLAIMER: I'm still an uber-n00b with programming concepts and know just enough VBS to
Disclaimer: i have searched genericly (Google) and here for some information on this topic,
Disclaimer: This is part of the requirement of the program, so it's not meant

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.