NSTimer in Objective-C: Example (Video)
Learn how NSTimer works in Objective-C with a simple video tutorial: an app that increments an integer variable every second. Project download included.
In this video tutorial, we are going to show how a "Timer" works in Objective-C, using a simple app that increments an integer variable by one every second (or every "whatever you want").
Here is how NSTimer works "in broad strokes":
timer = [NSTimer scheduledTimerWithTimeInterval:1.0 // The timer fires every second
target:self // This timer runs in this view
selector:@selector(contar) // The contar method is run
userInfo:nil
repeats:YES]; // The timer is repeating, that is, it fires every second (in this case)
You can download the project for this video tutorial HERE.
“NSTimer in Objective-C: Example (Video)” by Ricardo Moya at jarroba.com, licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0. Registered at Safe Creative.

You may also like
UITableView in Objective-C: Example (Video)
Learn how to build dynamic tables with UITableView on iPhone in Objective-C, with a video tutorial, a UINavigationBar and a downloadable project.
Switching Automatically from One ViewController to Another (iPhone)
Learn how to switch from one ViewController to another automatically on iPhone, with no user interaction, using an NSTimer and a Storyboard ID.
Tab Bar Controller in Objective-C – Example (Video)
Learn how to work with a Tab Bar Controller in Objective-C and manage each of its views independently, with a video tutorial and example code.
How to Program in C with Xcode on Mac (VIDEO)
Learn how to create, compile and run a C project with Xcode on your Mac. Watch the video tutorial and grab the sample code used in it.

Leave a comment