iOS / Objective-c – Simple NSTimer

Here’s a simple use of NSTimer to repeatedly trigger a method call every X seconds in Objective-c, for iOS.

Declare NSTimer variable in header file

NSTimer *myTimer;

Initialise myTimer at the appropriate point in code. Could be viewDidLoad on iPhone or willActivate on Apple Watch. My example triggers the method named updateDisplay at 5 second intervals. Note that I’ve set repeats: YES.
You can trigger the method for a one off call after X seconds by setting repeats: NO.

myTimer= [NSTimerscheduledTimerWithTimeInterval:5.0
target:self
selector:@selector(updateDisplay)
userInfo:nil
repeats:YES];

The above code both primes and starts the timer.

To end the timer. Could be didDeactivate on apple Watch, for example

[myTimer invalidate];
myTimer = nil;

Advertisements

iOS – How long do Apple take to review your iPhone app?

LAST UPDATED: 25/06/2014

This is a difficult question to answer considering the varied range of complexities involved in testing an iPhone application.

I can however share my experience using Apple’s Developer Program and iTunes Connect.

Number of apps on the App Store: 42
Average time between submission and approval: 8.17 Days

Average time Waiting For Review: 6.74 Days
Average time In Review: 1.55 Days

Maximum time between submission and approval: 14 days
Minimum time between submission and approval: 5 days

Maximum time Waiting For Review: 13 Days
Minimum time Waiting For Review: 4 Days

Maximum. time In Review: 16 Days
Minimum time In Review: 30 minutes

Looking for an iPhone app? I can build it… get in touch 0844 833 0700 or rob@reactivapps.co.uk