IPhone app connecting from FLipSideView to MainView?

I am trying to learn Objective-C and iPhone programming, but I am stuck in a problem. I have a utility application, and I have text in my MainView and a button that changes the text when I click on it. Easy and works great. But what if I don’t place the button on the “back side” of the FlipSideView and still make it change the text on the front (MainView)? How do I get an opinion to talk together? I tried a lot of different things and looked for the answer, but did not seem to understand it.

It would be great if someone got an answer, or perhaps a link to a tutorial / example.

0
source share
1 answer

, , MainViewController:

- (IBAction)showInfo:(id)sender {    

    FlipsideViewController *controller = [[FlipsideViewController alloc] initWithNibName:@"FlipsideView" bundle:nil];
    controller.delegate = self;
...
}

, FlipSideController MainViewController.

FlipSideViewController, - :

- (IBAction)changeTextInMainView
{
    [(MainViewController *)self.delegate changeText];
}

. IB, .

- MainViewController

- (void)changeText
{
    self.myLabel.text = @"text changed to this";
}

.

(, ), , . Value Value viewController , .

+1

Source: https://habr.com/ru/post/1791626/


All Articles