I am using Tapku calendar on my project .In the method for selecting a date
i showed another view on the view.Here is my code
- (void)calendarMonthView:(TKCalendarMonthView *)monthView didSelectDate:(NSDate *)date {
self.dataController=[[TimeCardDataController alloc] init];
self.dataController.managedObjectContext=[self context];
[self.dataController initWithTimeCards];
NSDate *weekStartDay=[date weekFirstDate];
NSDate *weekEndDay=[date weekLastDate];
self.billdailyValuePositiveArray= [self.dataController getTimeCardWithStartData:date endDate:date timeCardType:TIMECARD_STATUS_BILLABLE];
self.billweeklyValueNegetiveArray= [self.dataController getTimeCardWithStartData:weekStartDay endDate:weekEndDay timeCardType:TIMECARD_STATUS_NONBILLABLE];
self.billweeklyValuePositiveArray= [self.dataController getTimeCardWithStartData:weekStartDay endDate:weekEndDay timeCardType:TIMECARD_STATUS_BILLABLE];
self.billdailyValueNegetiveArray= [self.dataController getTimeCardWithStartData:date endDate:date timeCardType:TIMECARD_STATUS_NONBILLABLE];
self.syncweeklyValuePositiveArray=[self.dataController getTimeCardWithStartData:weekStartDay endDate:weekEndDay timeCardType:TIMECARD_STATUS_SYNCED];
self.syncweeklyValueNegetiveArray=[self.dataController getTimeCardWithStartData:weekStartDay endDate:weekEndDay timeCardType:TIMECARD_STATUS_NOTSYNCED];
self.syncdailyValuePositiveArray= [self.dataController getTimeCardWithStartData:date endDate:date timeCardType:TIMECARD_STATUS_SYNCED];
self.syncdailyValueNegetiveArray= [self.dataController getTimeCardWithStartData:date endDate:date timeCardType:TIMECARD_STATUS_NOTSYNCED];
self.postweeklyValuePositiveArray= [self.dataController getTimeCardWithStartData:weekStartDay endDate:weekEndDay timeCardType:TIMECARD_STATUS_POSTED];
self.postweeklyValueNegetiveArray= [self.dataController getTimeCardWithStartData:weekStartDay endDate:weekEndDay timeCardType:TIMECARD_STATUS_NOTPOSTED];
self.postdailyValuePositiveArray= [self.dataController getTimeCardWithStartData:date endDate:date timeCardType:TIMECARD_STATUS_POSTED];
self.postdailyValueNegetiveArray= [self.dataController getTimeCardWithStartData:date endDate:date timeCardType:TIMECARD_STATUS_NOTPOSTED];
[self toggleCalendar];
[self doOn:date];
}
the do on method shows another view. But after clicking a date it shows the view .But after that the system shows EXC_BAD_ACCESS.Any ideas.. I am trying but cant find the error . Please i need help
Here is the code for the methods above:::::::
-(NSMutableArray *) getTimeCardWithStartData:(NSDate *) startDate endDate:(NSDate *)endDate timeCardType:(NSString *) timeCardType
{
NSMutableArray* timeCardArray=[[NSMutableArray alloc] init];
NSMutableArray *categoryTimeCardArray=[[NSMutableArray alloc] init] ;
if ([timeCardType isEqualToString:TIMECARD_STATUS_BILLABLE])
{
categoryTimeCardArray=[self fetchedTimeCardWithStartDate:startDate endDate:endDate fetchedCategoryTimeCard:self.fetchedBillableTimeCards];
}
else if([timeCardType isEqualToString:TIMECARD_STATUS_NONBILLABLE])
{
categoryTimeCardArray=[self fetchedTimeCardWithStartDate:startDate endDate:endDate fetchedCategoryTimeCard:self.fetchedNonBillableTimeCards];
}
else if ([timeCardType isEqualToString:TIMECARD_STATUS_POSTED])
{
categoryTimeCardArray=[self fetchedTimeCardWithStartDate:startDate endDate:endDate fetchedCategoryTimeCard:self.fetchedPostedTimeCards];
}
else if([timeCardType isEqualToString:TIMECARD_STATUS_NOTPOSTED])
{
categoryTimeCardArray=[self fetchedTimeCardWithStartDate:startDate endDate:endDate fetchedCategoryTimeCard:self.fetchedNotPostedTimeCards];
}
else if([timeCardType isEqualToString:TIMECARD_STATUS_SYNCED])
{
categoryTimeCardArray=[self fetchedTimeCardWithStartDate:startDate endDate:endDate fetchedCategoryTimeCard:fetchedSyncedTimeCards];
}
else if ([timeCardType isEqualToString:TIMECARD_STATUS_NOTSYNCED])
{
categoryTimeCardArray=[self fetchedTimeCardWithStartDate:startDate endDate:endDate fetchedCategoryTimeCard:fetchedNotSyncedTimeCards];
}
return categoryTimeCardArray;
}
This is the initWithTimeCards method
-(void) initWithTimeCards
{
[self fetchAllTimeCard];
fetchedTimecards=[[NSArray alloc] init];
fetchedBillableTimeCards=[[NSArray alloc] init];
fetchedBillableTimeCards=[[NSArray alloc] init];
self.fetchedNonBillableTimeCards =[[NSArray alloc] init];
self.fetchedPostedTimeCards=[[NSArray alloc] init];
self.fetchedNotPostedTimeCards=[[NSArray alloc] init];
fetchedSyncedTimeCards=[[NSArray alloc] init];
fetchedNotSyncedTimeCards=[[NSArray alloc] init];
self.fetchedNonBillableTimeCards =[self fetchTimceCardWithBillStatus:TIMECARD_BILL_STATUS_NONBILLABLE];
self.fetchedPostedTimeCards=[self fetchTimceCardWithPostStatus:TIMECARD_BILL_STATUS_POSTED];
self.fetchedNotPostedTimeCards=[self fetchTimceCardWithPostStatus:TIMECARD_BILL_STATUS_NOTPOSTED];
fetchedSyncedTimeCards=[self fetchTimceCardWithSyncStatus:TIMECARD_BILL_STATUS_SYNCED];
fetchedNotSyncedTimeCards=[self fetchTimceCardWithSyncStatus:TIMECARD_BILL_STATUS_NOTSYNCED];
}
`