O'Reilly logo

Programming in Objective-C, Sixth Edition by Stephen G. Kochan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The while Statement

The while statement further extends the Objective-C language’s repertoire of looping capabilities. The syntax of this frequently used construct is as follows:

while ( expression )    program statement

The expression specified inside the parentheses is evaluated. If the result of the expression evaluation is true, the program statement that immediately follows is executed. After execution of this statement (or statements, if enclosed in braces), expression is again evaluated. If the result of the evaluation is true, the program statement is again executed. This process continues until expression finally evaluates false, at which point the loop is terminated. Execution of the program then continues with the statement that follows ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required