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

How to take a screenshot on Apple Watch

It’s a little tricky but you can take a screenshot on Apple Watch, handy when you want a live shot of an app your developing. Or perhaps you want a lasting reminder of some notification or other. Either way, follow these steps:

1. Get a good grip of your Apple watch.

If you wear with the side buttons facing your hand:

Placing your thumb on the smooth side
Rest your first finger over the digital crown
Rest your middle finger on the side button

If you wear with the side buttons facing your elbow:

Placing your first finger on the smooth side
Rest your thumb over the digital crown and the side button

2. Press the digital crown and side button at the same time.

The two buttons pressed at the same time will result in a screenshot of the current display. A flash of the screen accompanied by the camera shutter sound signifies a successful screenshot.

3. View and share the image

The screenshot from your Apple watch is saved to the paired iPhones camera roll. Open photos on iPhone to view your screenshot. Tap the share button to view the options.

IMG_7954

P.S. you can see the full Apple Watch user guide here: apple.co/1IPuZoa

iOS – Gadget House Project

1

My home automation app running an a wall mounted iPad. It brings a number of technologies and coding platforms together to run behind a simple & easy-to-use interface. Basically, I get to control a bunch of stuff in my house from my iPad or iPhone.

Lazy?: A little bit. Geeky?: More than a little bit.

It not only works from my home wifi, but anywhere with web connection. Useful to check in on the security cams and control lights, sockets, heating, music, etc. It links to open into other apps for Hive heating control, Sonos audio throughout the house and some others for my gadgets.

I add to the project as & when I get my hands on new stuff!

2

3

5

 



Tech Specs:
I use Lightwave RF (http://www.lightwaverf.co.uk/) products throughout my home – power sockets, light switches, energy monitor, wifi link – which enable direct communication via the wifi link. The public iOS app was okay but I wanted something a little easier to use that was customised to my environment. There’s no API for the wifi link, so I had to create one. The architect’s drawings provide a great backdrop for room controls.

 

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