objective c - iOS - update UILabel text periodically with our user interaction -


I have some labels on my UI that look like something "2s ago", "1h ago" ... now I want to update them from time to time without the user's contact, how can I get it?

Use when the screen opens and you display the labels, decide when you want to You will update, you have updated the label by saying "2s ago", and the next thing you want your users to see "1 min ago" You schedule a timer task to fire in 58 seconds, and provide a callback selector that updates the label, and determines the timing of the timer's next shoot.

Since you are likely to use irregular intervals (60 seconds for the first hour, 60 minutes for the next 23 hours, then one day) you should set your timer without repeating.

Do not forget to cancel the time when the scene disappears.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -