0

カレンダーは完全に機能しています。カレンダーのイベントをtapku カレンダーに表示します。また、それらを編集することもできるので、編集にはEKEventEditViewControllerを使用しているので、編集が完了したら

- (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 は、null 以外の値を含む出力です。

4

1 に答える 1

0
 @property (strong,nonatomic) TKCalendarMonthView *monthView;
 [self.monthView reload];

 note: do not @synthesize property
于 2013-08-22T13:02:18.910 に答える