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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:46:45+00:00 2026-06-06T19:46:45+00:00

I just went through trying to make an alarm clock app with local notifications

  • 0

I just went through trying to make an alarm clock app with local notifications but that didn’t do the trick because I needed an alert to appear instead of it going into notification centre in iOS 5+

So far I’ve been struggling greatly with nstimer and its functions so I was wondering if anyone could help out.

I want when the user selects a time (through UIDatePicker, only time) for an alert to be displayed at exactly this time. I have figured out how to get the time from UIDatePicker but I do not know how to properly set the firing function of nstimer. This is what I have attempted so far, if anyone could help… be much appreciated. Thank you

Example (it keeps going into the function every second opposed to a certain time I told it too… not what I want):

NSDate *timestamp;
NSDateComponents *comps = [[[NSDateComponents alloc] init] autorelease];

[comps setHour:2];
[comps setMinute:8];
timestamp = [[NSCalendar currentCalendar] dateFromComponents:comps];

NSTimer *f = [[NSTimer alloc] initWithFireDate:timestamp
                             interval:0
                               target:self
                             selector:@selector(test)
                             userInfo:nil repeats:YES];

NSRunLoop *runner = [NSRunLoop currentRunLoop];
[runner addTimer:f forMode: NSDefaultRunLoopMode]; 
  • 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-06-06T19:46:47+00:00Added an answer on June 6, 2026 at 7:46 pm

    As @Nate said change

    NSTimer *f = [[NSTimer alloc] initWithFireDate:timestamp
                                 interval:0
                                   target:self
                                 selector:@selector(test)
                                 userInfo:nil repeats:YES];
    

    To

    NSTimer *f = [[NSTimer alloc] initWithFireDate:timestamp
                                 interval:0
                                   target:self
                                 selector:@selector(test)
                                 userInfo:nil repeats:NO]; //<-- Change here
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just went through a bunch of stuff trying to figure out how to
I just went through writing a fairly lengthly application in c++ using mingw and
Just as the title says. As i went through different explanations for choices made
Here's the GitHub link: https://github.com/guicocoa/calendar I went through the source code and I'm trying
This is 'sorta' urgent since my app just went live today. My app works
I'm trying use rich:suggestionbox . I went through the tutorial provided by the Richfaces.
I just installed the boost 1.49 version on ubuntu and the process went smooth.
I just upgraded from Rails 3.0.3 to 3.2.1. The upgrade went smoothly on my
I just wrote this into my WebForms .aspx: <span id=GenerateChartButton runat=server></span> I went to
Just checking my JS and I have an error, but I cannot see where.

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.