0

I am trying to send a message from a popover to another viewcontroller when a button is pressed.

The problem is: When I click in the button, nothing changes in the viewcontroller.

And the popover does not miss itself when the button is pressed.

Here is my IBAction:

- (IBAction)sendFirstInformation:(id)sender {

    PlywoodViewController *PL1 = [self.storyboard instantiateViewControllerWithIdentifier:@"Plywood"];

    PL1.receiverLabel.text = @"TESTE";
    PL1.receiverLabel.textColor = [UIColor blackColor];   

    NSLog(@"It was pressed");

}

The NSLog works fine, but the UILabel (receiverLabel) does not change on the PL1.

Any ideas? Do I have to implement anything on the class of the viewcontroller or is it a problem in the popover IBAction?

P.S.: Both of them were created as UIViewControllers, so I guess the methods for popovers does not work (or maybe not, I don't really know lol).

  • Are you sure `receiverLabel` is instantiated correctly? Also, a `UIPopover` will only dismiss itself when a view outside of its hierarchy is tapped; if you want to dismiss it with your button tap, use `dismissPopoverAnimated`. – Graham Jul 04 '13 at 15:23
  • I put an IBOutlet UILabel *receiver between the braces in the beggining: PlywoodViewController : UIViewController { IBOutlet UILabel *receiverLabel; } and this @property (weak, nonatomic) IBOutlet UILabel *receiverLabel; Is it right? Thanks for your help, @Graham! – Fernando Augusto Marins Jul 05 '13 at 01:33
  • That looks right, but have you hooked this outlet up in interace builder? – Graham Jul 05 '13 at 10:00
  • Yeah, I did hook in IB. Is there anything to do with delegates? Do I have to implement one? Thanks again, @Graham. – Fernando Augusto Marins Jul 05 '13 at 13:14

0 Answers0