私はxcodeにかなり慣れていないので、あまり知りません。最初のビューで textField にテキストを入力し、ボタンをクリックして、2 番目のビューでラベルのテキストを変更するアプリを作成しています。
これがコードです。(小さいバージョン) First View コード。
#import "SecondViewController.h"
- (IBAction)Settext:(id)sender;
@property (weak, nonatomic) IBOutlet UITextField *textField;
@implementation FirstViewController
- (IBAction)Settext:(id)sender {
self.text = self.textField.text;
self.label.text = self.text
}
@end