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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:53:19+00:00 2026-06-14T07:53:19+00:00

I am a new programmer and have searched for this answer, but think I

  • 0

I am a new programmer and have searched for this answer, but think I might not be using the right terminology.

What I am trying to do is allow the user to use my application, which is a game, only once in a 24 hour period. If they try to play the game earlier than the 24 hour period, I would like an alert that tells them to come back later. I have seen this done for other games that give you “credits”, but can’t seem to find the code.

Any help is 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-06-14T07:53:20+00:00Added an answer on June 14, 2026 at 7:53 am

    Use the NSDate class to get the current date ([NSDate date]), and then save this value using the NSUserDefaults class. When the app is opened, retrieve the value and then compare the old date with the current date. If it has been a day, don’t do anything. Otherwise, show an alert.

    //setting the date
    [[NSUserDefaults standardUserDefaults] setObject:[NSDate date] forKey:@"Date"];
    
    //retrieve date
    NSDate *date = [[NSUserDefaults standardUserDefaults] objectForKey:@"Date"];
    
    //now compare the dates
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

New programmer here, I am trying to understand and break down this code below
I have searched for an answer to this, and it is probably a beginner
I'm new to R, and new to this forum. I've searched but cannot easily
New Programmer here. Trying space invaders. I have a 2 dimensional array of objects
i am a new programmer in visual studio (using the 2008 version) i have
I am a very new programmer, I have made a couple basic applications, however
I'm a new Python programmer who is having a little trouble using 'self' in
I am a new Ruby programmer and have been looking through some tutorials for
I’m a new iPhone programmer I have created some small views without delegates.... If
I am a new programmer in Python and I am trying to do some

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.