Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5993631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:42:09+00:00 2026-05-22T23:42:09+00:00

In my alarm based application on iPhone,I am using TdCalenderView code by tinyfool.On that

  • 0

In my alarm based application on iPhone,I am using TdCalenderView code by tinyfool.On that calendar I am calling setDayFlag:day in drawDateWords method for the day on which alarm is set.Tapping the date opens the list of alarms for the corresponding date.
Now,I am also using Tab bar in the same application.On clicking item 0 of tab bar I am showing view containing calendar and on clicking item 1 I am showing the view to write and save the note.
When I am writing a note and saving it,I want a point to be plotted on corresponding date.
But it doesn’t happen.The point is not there.But when I tap once on the date,the point appears and on second tap the list is shown.
Here is my code:

appdelegate.m

calendar=[[TdCalendarView alloc]init];

View containing tab bar

this is switch case for tab item tags based on which I am showing and hiding the views

       switch (tag) {

            case 0:

                WriteANoteView.hidden=YES;

                RecordANoteView.hidden=YES;

                BirthdayView.hidden=YES;

                AllNotesView.hidden=NO;

                app.calendar initCalView];

                [app.calendar drawDateWords];
                            break;

TdCalendarView.m

        -(void)initCalView{

        currentTime=CFAbsoluteTimeGetCurrent();

    currentMonthDate=CFAbsoluteTimeGetGregorianDate(currentTime,CFTimeZoneCopyDefault());

        currentMonthDate.day=1;

        currentSelectDate.year=0;

        monthFlagArray=malloc(sizeof(int)*93);

        [self clearAllDayFlag]; 

         app=(Note_TakerAppDelegate *)[[UIApplication sharedApplication] delegate];

        [app getWrittenNotesAndDates];

        app.calendar.tableContentArray=[[NSMutableArray alloc]init];

        app.calendar.tableRDatesArray=[[NSMutableArray alloc]init];

        app.calendar.tableCrDatesArray=[[NSMutableArray alloc]init];


    }


    -(void)drawDateWords{
        CGContextRef ctx=UIGraphicsGetCurrentContext();
        int width=self.frame.size.width;

        int dayCount=[self getDayCountOfaMonth:currentMonthDate];
        int day=0;
        int x=0;
        int y=0;
        int s_width=width/7;
        int curr_Weekday=[self getMonthWeekday:currentMonthDate];
        UIFont *weekfont=[UIFont boldSystemFontOfSize:12];





        for(int i=1;i<dayCount+1;i++)
        {

            day=i+curr_Weekday-2;
            x=day % 7;
            y=day / 7;
            NSString *date=[[[NSString alloc] initWithFormat:@"%2d",i] autorelease];
    [date drawAtPoint:CGPointMake(x*s_width+15,y*itemHeight+headHeight)withFont:weekfont];
            NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];

            for(int j=0;j<[app.datesofTextArray count];j++)
            {   

                if([[NSString stringWithFormat:@"%@",[app.datesofTextArray objectAtIndex:j]] length] !=0)
                {


                [dateFormatter setDateFormat:@"dd/MM/yyyy hh:mm:ss"];
                NSDate *dateFromString=[dateFormatter dateFromString:[NSString stringWithFormat:@"%@",[app.datesofTextArray objectAtIndex:j]]];
                [dateFormatter setDateFormat:@"dd"];
                int day1=[[dateFormatter stringFromDate:dateFromString]intValue];
                [dateFormatter setDateFormat:@"MM"];
                int month1=[[dateFormatter stringFromDate:dateFromString]intValue];
               [dateFormatter setDateFormat:@"yyyy"];
                int year1=[[dateFormatter stringFromDate:dateFromString]intValue];
                if(day1==day && month1==currentMonthDate.month && year1==currentMonthDate.year)
                {
                    NSLog(@"in if rdate day1=%d,month1=%d,year1=%d",day1,month1,year1);  
                    [self setDayFlag:day flag:1];
                    [self paintDot:day];

                }
            }
            else
            {
                //NSLog(@"in else date=%@",[app.datesofTextArray objectAtIndex:i]);

                [dateFormatter setDateFormat:@"dd/MM/yyyy hh:mm:ss"];
                NSDate *dateFromString=[dateFormatter dateFromString:[NSString stringWithFormat:@"%@",[app.creationDates objectAtIndex:j]]];
                [dateFormatter setDateFormat:@"dd"];
                int day1=[[dateFormatter stringFromDate:dateFromString]intValue];
                [dateFormatter setDateFormat:@"MM"];
                int month1=[[dateFormatter stringFromDate:dateFromString]intValue];
                [dateFormatter setDateFormat:@"yyyy"];
                int year1=[[dateFormatter stringFromDate:dateFromString]intValue];
                if(day1==day && month1==currentMonthDate.month && year1==currentMonthDate.year)
                {
                    NSLog(@"in if cdate day1=%d,month1=%d,year1=%d",day1,month1,year1);
                    [self setDayFlag:day flag:1];
                    [self paintDot:day];
                }


            }

        }

        [dateFormatter release];

        CGContextSetRGBFillColor(ctx, 0, 0, 0, 1);

    }


}

I am not getting why this is happening.Any help would be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T23:42:09+00:00Added an answer on May 22, 2026 at 11:42 pm

    Ok.This may sound like a hack but it eventually worked.
    I called [TdCalenderView moveNextMonth] before showing calendar view and [TdCalenderView movePrevMonth] after showing the calendar view with a flag to manage cancelling the animation when the method is invoked by Tab bar.It refreshed my calendar and issue is resolved.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a code that sets a new repeating alarm (on production I'll use
Want to create an alarm application, that will play a music file at a
I have a custom validation method that ensures an alarm can only be set
I am developing an iPhone alarm app based on local notifications. On deleting an
I'm using UILocalNotification for Alarm Purpose. I have a custom option for repeat based
I noticed that an alarm is disabled when the application which sets this alarm
My application needs to show some notifications for schedules (like Alarm), based on time
I have to maintain statistics based on session in my application. Problem is that
I am using this code to set a Alarm everyday for 8 oclock the
I am still working on my location-based alarm android application. I have an AlarmService

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.