我正在实现一个日历作为我的应用程序的一部分,它在 nslog 中显示选定的日期,但我需要将此值发送到标签,它在 nslog 中将值显示为 2011-02-08
我在 ib 中创建了一个标签,(并连接到它)在 *ViewController.h
IBOutlet UILabel *dateis;
在 *ViewController.m 中
- (void)calendarView:(KLCalendarView *)calendarView tappedTile:(KLTile *)aTile{
NSLog(@"Date Selected is %@",[aTile date]);
[aTile flash];
dateis = [aTile date];
}
但我收到警告>
Incompatible Objective-C types assigning 'struct KLDate *', expected 'struct UILabel *'
编辑,如果我使用
dateis.text = [aTile date];
我收到警告
incompatible Objective-C types 'struct KLDate *', expected 'struct NSString *' when passing argument 1 of 'setText:' from distinct Objective-C type
KLDate 是在日历中定义日期的方式,
- 那么如何将此值传递给标签(在 nslog 上工作,在 *.m 中查看代码调用)
非常感谢!!