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?
Share
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:
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?