我可以将整数值传递给另一个类,但日期呢?我使用下面的代码传递整数:如何将日期值传递给另一个类
-(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;
}
}
我的问题是用户输入的,在我的第一步类的UIDatePicker一个日期,但如何日期被传递到第二步类?任何帮助,将不胜感激。
我做到了,但现在我得到一个错误:“不兼容的指针类型分配给‘的NSDate * _strong’从‘的NSString *’” – 2013-02-19 05:13:24
好吧, Eric,祝你好运%) – 2013-02-19 05:24:48