Custom Calender Help

4 views
Skip to first unread message

▶ Dev. Haider

unread,
Dec 30, 2015, 2:40:37 PM12/30/15
to iphonesdkd...@googlegroups.com

Hello everyone, i need a little help regarding the calender dates.

Im creating NSDate from current date to month end date once its done i plot these dates on tableview. than i call a api on which i get task for that dates.

I place dates on tableview header and in numberOfRowsInSection i compare calender dates to dates i get in the api request. 

So what should happen, if current calender dates matches result from api dates than the current dates section must return the number of rows its match.

Below is my code, its working but its return rows for every section.


for (int i =0; i<[self.calenderDates count]; i++) {

                      NSString * currentDate = self.calenderDates[i];                      

                      for (int j =0; j<[self.papikerCalender count]; j++) {

                          NSString * papikDate = [self.papikerCalender[j] valueForKey:@"strat_date"];

                          if ([currentDate isEqualToString:papikDate]) {

                              [self.rowData addObject:self.papikerCalender[j]];

                              [self.dataDictionay setObject:self.rowData forKey:currentDate];

                              

                              

                          }

                      }

                  }



- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    NSString * currentDate = self.calenderDates[section];

    NSArray * dicDate = [self.dataDictionay valueForKey:currentDate];

    return [dicDate count];

}




--
 
Developer

Reply all
Reply to author
Forward
0 new messages