PMCalendar
PMCalendar copied to clipboard
How to set currentDate to show selected month calendar
Sorry, I don't know how to set currentDate in PMDaysView ? [PMCalendarController setCurrentDate: ] is right to set currentDate ?
Yes.
-Pavel
On Sep 13, 2012, at 7:04 PM, avocet [email protected] wrote:
Sorry, I don't know how to set currentDate in PMDaysView ? [PMCalendarController setCurrentDate: ] is right to set currentDate ?
— Reply to this email directly or view it on GitHubhttps://github.com/kovpas/PMCalendar/issues/7.
But I can't do it in my codes! as in picture below, https://picasaweb.google.com/lh/photo/AEnbhkFjd_tROED6kCTNMdMTjNZETYmyPJy0liipFm0?feat=directlink
Looks like another thing which is missing, yes. Will look into this when I have enough time.
Thanks.
Hi I added the project to my project. I can show the calendar but when I pressed the next or previous month button I get this message; I cant show the next or previous month of the year...
[__NSDate monthStartDate]: message sent to deallocated instance what can I do for this... Please help me...
This is my code
self.pmCC = [[PMCalendarController alloc] initWithThemeName:@"default"]; pmCC.delegate = self; pmCC.mondayFirstDayOfWeek = NO; [pmCC presentCalendarFromRect:CGRectZero inView:[self.view superview] permittedArrowDirections:PMCalendarArrowDirectionAny animated:YES]; [self calendarController:pmCC didChangePeriod:pmCC.period];
Hi,
Have you tried to run enclosed demo project? Does it work?
Yes demo is working correctly...
I call the calender from a UIBarButton is that affect ?
Not sure. Obviously NSDate object is being released somewhere in an incorrect place, but I don't see anything wrong in your code.
Ok I will look is there another NSDate object that released.. Thank you so much...
There is NSDate object that I take the currentDate to use another function. But I dont release any of that object. :(
Language can affect this error. I am from Türkiye.
In PMCalendarView.m file
in - (void)drawRect:(CGRect)rect function
NSDate *dateOnFirst = [_currentDate monthStartDate]; on this row throw this error
-[__NSDate monthStartDate]: message sent to deallocated instance 0xacbe060
When I pressed the next or previous month...
That's weird. currentDate has a strong reference, it shouldn't be released.
Is there any solution we can do
To be honest, I have no idea what could be wrong in the code you've wrote. As long as demo project works, I assume that the problem is on your side.
-Pavel
On Sep 18, 2012, at 12:58 PM, Kemal Serkan YILDIRIM < [email protected]> wrote:
Is there any solution we can do
— Reply to this email directly or view it on GitHubhttps://github.com/kovpas/PMCalendar/issues/7#issuecomment-8649881.
Thank you so much
if Objective-C ARC set to NO, error In PMCalendarView.m file
in - (void)drawRect:(CGRect)rect function
NSDate *dateOnFirst = [_currentDate monthStartDate]; on this row throw this error
-[__NSDate monthStartDate]: message sent to deallocated instance 0xacbe060
ARC is supposed to be turned on.
[__NSDate numberOfDaysInMonth]: message sent to deallocated instance 0x32072ff0
I try again to add PMCalendar to my project..
I get that message...
If you find a way to fix that, please make a pull request.
to solve this problem just replace NSDateComponents *eComponents = [gregorian components:NSDayCalendarUnit | NSMonthCalendarUnit | NSYearCalendarUnit fromDate:_currentDate]; with NSDateComponents *eComponents = [gregorian components:NSDayCalendarUnit | NSMonthCalendarUnit | NSYearCalendarUnit fromDate:[_currentDate copy]];
pmcalendarview.m