整数値を別のクラスに渡すことはできますが、日付はどうでしょうか? 次のコードを使用して整数を渡しています。
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([[segue identifier] isEqualToString:@"toStep2"]) {
Step2ViewController *detailViewController = [segue destinationViewController];
NSLog(@"text : %@",self.wrp.text);
//This is the id infoRequest, which is a pointer to the object
//Look at the viewDidLoad in the Destination implementation.
detailViewController.infoRequest = self.wrp.text;
}
}
私の問題は、ユーザーが Step1 クラスで UIDatePicker を使用して日付を入力することですが、どのようにして日付を Step2 クラスに渡すことができますか? どんな助けでも大歓迎です。