Iphone 重新加载tapku日历时出现问题
我的日历工作正常我在我的tapku日历中显示日历中的事件,我还可以编辑它们,以便编辑我正在使用EKEventEditViewController完成编辑Iphone 重新加载tapku日历时出现问题,iphone,ios,tapku,Iphone,Ios,Tapku,我的日历工作正常我在我的tapku日历中显示日历中的事件,我还可以编辑它们,以便编辑我正在使用EKEventEditViewController完成编辑 - (void)eventEditViewController:(EKEventEditViewController *)controller didCompleteWithAction:(EKEventEditViewAction)action 接到电话后,我会尝试在此处更新我的日历 TKCalendarMonthVie
- (void)eventEditViewController:(EKEventEditViewController *)controller
didCompleteWithAction:(EKEventEditViewAction)action
接到电话后,我会尝试在此处更新我的日历
TKCalendarMonthViewController *tk = [[TKCalendarMonthViewController alloc]init];
[tk loadView];
loadview方法如下,现在我将在评论中解释错误
在加载我的日历时调用此方法。所以为了再次加载它,我再次调用这个方法
- (void) loadView{
[super loadView];
_monthView = [[TKCalendarMonthView alloc] initWithSundayAsFirst:_sundayFirst];
_monthView.delegate = self;
_monthView.dataSource = self;
NSLog(@"::%@",_monthView.dataSource);
NSLog(@"::%@",_monthView.delegate);
[self.view addSubview:_monthView];
[_monthView reload]; // reload method get called
}
- (void) reload{
NSArray *dates = [TKCalendarMonthTiles rangeOfDatesInMonthGrid:[currentTile monthDate] startOnSunday:sunday];
NSLog(@"%@",dates);
NSLog(@"%@",self.dataSource);
// below calendarMonthView:self method get called when my cal is getting called first time by it self but when i try by creating object of class like i showed in that delegate method then below method is not getting called and this is why my cal is not getting updated
// SO THE PROBLEM IS THIS METHOD IS NOT GETTING CALLED
NSArray *ar = [self.dataSource calendarMonthView:self marksFromDate:[dates objectAtIndex:0] toDate:[dates lastObject]];
TKCalendarMonthTiles *refresh = [[TKCalendarMonthTiles alloc] initWithMonth:[currentTile monthDate] marks:ar startDayOnSunday:sunday];
[refresh setTarget:self action:@selector(tile:)];
[self.tileBox addSubview:refresh];
[currentTile removeFromSuperview];
currentTile = refresh;
}
所有NSLog都是打印的,其中的值都不是空的。您应该避免只回答代码,除非100%清楚地知道如何处理它。为了让本问答将来可能对其他用户有益,请编辑此问题,并解释您的代码如何解决OP的问题。
@property (strong,nonatomic) TKCalendarMonthView *monthView;
[self.monthView reload];
note: do not @synthesize property