Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have an app which allows users to redeem voucher codes, however I want to limit it so they can only claim one every 30 minutes.
So I somehow need to store the time they last redeemed a voucher, and if they try to redeem another, the app would check the last time and only give them a new voucher if the last one was over half an hour ago.
Would I store data in user prefs or is there a better way?
Storing a timestamp of when the last voucher was redeemed in NSUserDefaults is probably fine for a simple solution.
But how secure do you need this to be? As a general rule, and especially if this needs to be strictly enforced for financial reasons, never trust the client. Meaning that you should have a server to verify the codes, and enforce usage restrictions.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I have simple TableViewController with customers. Every cell has photo, name and phone number. I want to cache this information. So when you will be offline or has slow connection, you will see information from last refresh until data refresh again. Refresh will start every time you enter this screen. I will have more screens, where I will want to cache different informations. I want to ask you about best practice of caching in iOS.
My idea is to use CoreData with Fetched result controller. Is it good idea or not?
if it's limited data you need to cache, you can also consider NSUserDefaults to read - write and delete.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I'm writing a game where the user can have N lives, where each life is replenished after a set period of time, T.
What is the best way to implement this in iOS, given that the user may or may not have the app opened when a life replenishes.
I was thinking that I could fire a UILocalNotification, but is it guaranteed that this will always be fired (e.g. what if the phone was turned off)?
You don't want to use a notification for this as it is presented to the user. Instead, while the app is open you should be running a timer and replenishing when it fires. You should also be storing the replenish date, perhaps in user defaults or the keychain, so that if the app is closed you can compare that date to now when it is opened again and determine how many to replenish.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
My application is one page contract. I would like users to be able to sign the contract by clicking on a button. The contract is not a resource; it's plain HTML.
Every solution I have found so far relies on having a model that acts as votable. How can I implement a simple button that users may only click once, and display the number of users who have clicked it?
It's not possible to do this with static pages, at least not in a way that is clean and secure.
Think about it this way: every user is looking at a copy of the contract, which is being displayed to them on their browser (the client). If you want users to be able to cast votes that persist and be aware of votes cast by other users, then you need a server that keeps track of it centrally. That's why the solutions you have found so far rely on having a model, presumably backed with a table.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
In my game, I need to do a check to see if another player is signed in or not, if they are then I cannot attack them. Right now I'm doing that by setting a Boolean when the user signs in, and then setting it to NO with applicationDidEnterBackground, but I've been told this sometimes doesn't run especially if the App crashes.
So my question is, are there any other ways to determine if a player is signed in or not?
applicationDidEnterBackground will generally be called. If you're worried about crashes you can implement an uncaught exception handler. You can also consider having a, relatively infrequent, keep alive update sent to the server periodically and auto-logout the user if it isn't received.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
So I'm going to do an app. It will have about 100 recipes, and so far I've only done 4. I need to have it submitted to the App Store tomorrow.
My question is, if I'm not done by then, could I get away with just polishing what I have and then submitting it? Would Apple or my customers hate my client?
It is very rare in software development to release an application without a few known defects, so long as those defects are not critical to the functionality of the application itself. This is why versioned releases exist. That being said, unless you have a clear understanding of what your client wants, via a customer statement, it may be hard to determine whether or not your client will respond in a positive manner.
If you're down to a crunch, polish up what you've got, make sure it works, and cross your fingers. Your other option would be to request pushing back the release date.
4 out of a 100 probably wont cut it though. :P