
- Basic Objective-C
- Objective-C - Home
- Objective-C - Overview
- Objective-C - Environment Setup
- Objective-C - Program Structure
- Objective-C - Basic Syntax
- Objective-C - Data Types
- Objective-C - Variables
- Objective-C - Constants
- Objective-C - Operators
- Objective-C - Loops
- Objective-C - Decision Making
- Objective-C - Functions
- Objective-C - Blocks
- Objective-C - Numbers
- Objective-C - Arrays
- Objective-C - Pointers
- Objective-C - Strings
- Objective-C - Structures
- Objective-C - Preprocessors
- Objective-C - Typedef
- Objective-C - Type Casting
- Objective-C - Log Handling
- Objective-C - Error Handling
- Command-Line Arguments
- Advanced Objective-C
- Objective-C - Classes & Objects
- Objective-C - Inheritance
- Objective-C - Polymorphism
- Objective-C - Data Encapsulation
- Objective-C - Categories
- Objective-C - Posing
- Objective-C - Extensions
- Objective-C - Protocols
- Objective-C - Dynamic Binding
- Objective-C - Composite Objects
- Obj-C - Foundation Framework
- Objective-C - Fast Enumeration
- Obj-C - Memory Management
- Objective-C Useful Resources
- Objective-C - Quick Guide
- Objective-C - Useful Resources
- Objective-C - Discussion
continue statement in Objective-C
The continue statement in Objective-C programming language works somewhat like the break statement. Instead of forcing termination, however, continue forces the next iteration of the loop to take place, skipping any code in between.
For the for loop, continue statement causes the conditional test and increment portions of the loop to execute. For the while and do...while loops, continue statement causes the program control pass to the conditional tests.
Syntax
The syntax for a continue statement in Objective-C is as follows −
continue;
Flow Diagram

Example
#import <Foundation/Foundation.h> int main () { /* local variable definition */ int a = 10; /* do loop execution */ do { if( a == 15) { /* skip the iteration */ a = a + 1; continue; } NSLog(@"value of a: %d\n", a); a++; } while( a < 20 ); return 0; }
When the above code is compiled and executed, it produces the following result −
2013-09-07 22:20:35.647 demo[29998] value of a: 10 2013-09-07 22:20:35.647 demo[29998] value of a: 11 2013-09-07 22:20:35.647 demo[29998] value of a: 12 2013-09-07 22:20:35.647 demo[29998] value of a: 13 2013-09-07 22:20:35.647 demo[29998] value of a: 14 2013-09-07 22:20:35.647 demo[29998] value of a: 16 2013-09-07 22:20:35.647 demo[29998] value of a: 17 2013-09-07 22:20:35.647 demo[29998] value of a: 18 2013-09-07 22:20:35.647 demo[29998] value of a: 19
objective_c_loops.htm
Advertisements