我有一个日历视图,显示该月的日期,我想将输出放入我的标签,但我无法。我可以NSLog它但不能将其转移到标签中。这是我的代码:
- (void)calendarView:(DSLCalendarView *)calendarView didSelectRange:(DSLCalendarRange *)range {
if (range != nil) {
NSLog( @"%ld/%ld", (long)range.startDay.month, (long)range.endDay.day);
NSString *datechosen = ( @"%ld/%ld", range.startDay.month,range.endDay.day);
DatePicked.text = datechosen;
}
任何帮助都将不胜感激。
答案 0 :(得分:1)
尝试这样的事情
if(DatePicked)
{
DatePicked.text = datechosen;
}
else
{
NSLog(@"hey look, DatePicked is not connected to an IBOutlet");
}
答案 1 :(得分:0)
DatePicked.text = [NSString stringWithFormat:"%ld/%ld",(long)range.startDay.mont, (long)range.endDay.day];