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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:19:48+00:00 2026-06-08T23:19:48+00:00

I am working on a quote app, and I have my plist setup and

  • 0

I am working on a quote app, and I have my plist setup and each string in the plist stands as its own quote. What are some ways that I can have a TextView in one of my Views display a quote, and change it at midnight each day, and then mark the string as used, so that it will not repeat it, and keep going through at random order?

  • 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-08T23:19:50+00:00Added an answer on June 8, 2026 at 11:19 pm

    You could update your plist to either remove the quote or set a flag as used then exclude those from being selected.

    As far as when to mark one as used. I’m not sure everyday at midnight works with your model If its truly random then marking them as used at midnight doesn’t make much sense since they may not open the app every day and would miss random quotes. Where as if it were ordered there would be a quote a day.

    EDIT FROM OP:
    In the AppDelegate didFinishLaunch I added this code:

    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    
    if (! [defaults boolForKey:@"notFirstRun"]) {
    
        [defaults setBool:YES forKey:@"notFirstRun"];
    
        [defaults setInteger:0 forKey:@"verseKey"];
        [defaults synchronize];
    }
    NSTimeInterval date = [defaults doubleForKey:@"startTimeInterval"];
    
    NSTimeInterval dateNow = [NSDate timeIntervalSinceReferenceDate];
    
    NSTimeInterval difference = dateNow - date;
    
    difference = difference / 84000;
    
    if(difference >= 0 && difference <= 1) {
    
    }   
    
    if(difference >= 1 ) {
        NSLog(@"ITSMORE");
        NSInteger savedIndex = [[NSUserDefaults standardUserDefaults] integerForKey:@"verseKey"];
        savedIndex +=1;
        if (savedIndex == 200) {
            [defaults setInteger:0 forKey:@"verseKey"];
            dateNow = [NSDate timeIntervalSinceReferenceDate];
            [defaults setDouble:dateNow forKey:@"startTimeInterval"];
            [defaults synchronize];
        }
        else {
        [defaults setInteger:savedIndex forKey:@"verseKey"];
        dateNow = [NSDate timeIntervalSinceReferenceDate];
        [defaults setDouble:dateNow forKey:@"startTimeInterval"];
        [defaults synchronize];
        }
    }   
    

    I believe that this code should set the value of 0 for verseKey on firstRun and synchronize it with NSUserDefaults. Then, each time it is launched, it will see if more than 24 hours have passed. If it has, then it will add 1 to the key of verseKey until it hits 200 (I have a total of 200 quotes). Once 200 has been hit, it will reset it to 0. Then I set the TextView to objectAtIndex:key for verses, so that it will change. Sound about right?

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

Sidebar

Related Questions

I am working in a PHP app we have a particular string that we
I have an app setup where each user belongs to a company, and that
I've been working with app engine for quite some time, I know that there
I have an app prototype that was working on Iphone4 + iOS 4.3, build
I have a little app that downloads stock prices and was working perfectly (for
I'm about to release an app that I have been working on for quite
i'm working on an app that will have a listing of the data you've
I am working on a program that extracts real time quote for 900+ stocks
I'm working on the comments section for a site, where users can quote something
I'm trying to make it working for quite some time,but just can't seem to

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.