我已经按照教程 在类之间传递数据
做到了,并且工作正常,但我真的需要将一些字符串值(日期)发送到另一个视图,(我知道这很简单,但我对此很陌生!),
- 所以我的问题是我需要将这个字符串(日期)发送到另一个视图,字符串没问题,但我似乎(还)不知道如何构造函数,
我没有收到任何警告,但应用程序中断,
- (void)calendarView:(KLCalendarView *)calendarView tappedTile:(KLTile *)aTile{
NSLog(@"Date Selected is %@",[aTile date]);
string1 = [[aTile date] description];
dateis.text = string1; //label to check string is working
NSLog(@"ahi va! %@", string1);
NSString *cucux = dateis.text;
CroTime *croco = [CroTime alloc];
croco.string1 = cucux;
[self.view addSubview:croco.view];
NSLog(@"croco = %@", cucux);
}
控制台消息
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CroTime setString1:]: unrecognized selector sent to instance 0x5e2e1e0'
非常感谢!!