Question

I want to add a month view calendar for my iPhone project that will look identical to iPhone Calendar app. I have tried both Kal Calendar and Tapku. The problem is that Tapku just doesn't seem to work(if says November 2011 and the date now is Monday 31st. According to my iPhone Calendar and Mac it's 28th. Even more: if I chose a day on every second launch of Tapku it just crashes with EXC_BAD_ACCESS in this method:

- (NSDate*) dateSelected{
return [currentTile dateSelected];
}

And in the Kal calendar I can't find the way to add my own events if the date has been chosen. So basically I want to override the

-(void)didSelectDate:(KalDate *)date

so that after choosing any date a new view controller will appear. In the header of my class I have

@interface MyKalViewController : UIViewController<KalViewDelegate, UITableViewDelegate>

All in all: can someone please tell me how to add my own didSelectDate method or override the existing one? Or suggest some other month view calendar.

Thank you

edit:

Found the way to do it in Kal.

Just add this

if ([self.delegate respondsToSelector:@selector(didSelectDate:)]) {
    [self.delegate performSelector:@selector(didSelectDate:) withObject:[date NSDate]];
}

to

- (void)didSelectDate:(KalDate *)date

method in KalViewController.m file. Also don't forget to set delegate to self in the class that is using Kal:

kvc = [[KalViewController alloc]init];
kvc.delegate = self;

And make a didSelectDate method in the same class.

Hopefully it will help somebody once

P.S. will add an answer once 8 hours are passed. Or you can just copypaste it and I'll pick your answer as best :p

Was it helpful?

Solution

Found the way to do it in Kal.

Just add this

if ([self.delegate respondsToSelector:@selector(didSelectDate:)]) {
    [self.delegate performSelector:@selector(didSelectDate:) withObject:[date NSDate]];
}

to

- (void)didSelectDate:(KalDate *)date

method in KalViewController.m file. Also don't forget to set delegate to self in the class that is using Kal:

kvc = [[KalViewController alloc]init];
kvc.delegate = self;

And make a didSelectDate method in the same class.

Hopefully it will help somebody once

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top