Я пытаюсь изменить UITextView.text из SecondViewController в ViewController. Я могу это сделать, если это был тип NSString в SecondViewController, выполнив:Как изменить UITextField текст View2 из View1?
SVC.string = @"test";
Проблема заключается в том, что:
- messageBox.text не меняет
- SVC.messageBox.text возвращается (нуль)
Одним из методов в ViewController.m:
SecondViewController *SVC = [[SecondViewController alloc]initWithNibName:@"SecondViewController" bundle:nil];
SVC.messageBox.text = @"changed";
NSLog(@"SVC: %@", SVC.messageBox.text); // result = (null)
[self presentViewController:SVC animated:YES completion:NULL];
SecondViewController.h:
#import <UIKit/UIKit.h>
@interface SecondViewController : UIViewController
@property (nonatomic) IBOutlet UITextView *messageBox;
@end
SecondViewController.m:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
self.messageBox.text = @"first";
}
Как получить более с этим?