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 6991495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:30:37+00:00 2026-05-27T19:30:37+00:00

I am trying to create an app which has the ability to view calendar

  • 0

I am trying to create an app which has the ability to view calendar events. I am able to read all the properties but am having trouble with the EKAlarm. When I do an NSLog in the for loop it confirms that it should be hitting the 15min alarm log but it is passing over it.

for (int i = 0; i < [event1.alarms count]; i++) {

    if ([event1.alarms objectAtIndex:i]  ==  [EKAlarm alarmWithRelativeOffset:-900]) {
        NSLog(@"alarm: 15 min before");
    }else if([event1.alarms objectAtIndex:i] == [EKAlarm alarmWithRelativeOffset:-1800]) {
        NSLog(@"alarm: 30 min before");

    }else if([event1.alarms objectAtIndex:i] == [EKAlarm alarmWithRelativeOffset:-3600]) {
        NSLog(@"alarm: 1 hour before");

    }else if([event1.alarms objectAtIndex:i] == [EKAlarm alarmWithRelativeOffset:-86400]) {
        NSLog(@"alarm: 1 day before");

    }

}
  • 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-27T19:30:38+00:00Added an answer on May 27, 2026 at 7:30 pm

    What you’re doing here is comparing pointers between the EKAlarms that you saved in your NSArray and newly created alarms that you’re allocating at the time of the comparison.

    What you could use to test for equality is the relativeOffset property in your alarms.

    Something like:

    for (int i = 0; i < [event1.alarms count]; i++) {
    
        NSTimeInterval offset = [[event1.alarms objectAtIndex:i] relativeOffset];
    
        if (offset == -900) {
            NSLog(@"alarm: 15 min before");
        }
        else if(offset == -1800) {
            NSLog(@"alarm: 30 min before");
        }
        else if(offset == -3600) {
            NSLog(@"alarm: 1 hour before");
        }
        else if(offset == -86400) {
            NSLog(@"alarm: 1 day before");
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a horizontal scroll view which has a UILabel as
I'm new to Xcode and I'm trying to create an app which has a
I'm trying to create a rails app, but somethings going wrong, I'm getting a
Im trying to create a simple pan and zoom app using silverlight 4, but
I got an app which has a few slow pages, so I am trying
I'm trying to create a J2ME app, which talks to webserver using HttpConnection connector.
I have been working on an app all day which has been working fine
I am looking to create an app which has Speech to text. I am
I'm trying to create a photo based app and I want to be able
i'm trying to create an app which uses the combination of native functionality and

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.