For loop and if statement

后端 未结 3 516
耶瑟儿~
耶瑟儿~ 2021-01-17 06:22

I am working with the following for loop:

for (int intPrjName = 0; intPrjName < [arrPrjName count]; intPrjName++)

I have a if/else stat

3条回答
  •  猫巷女王i
    2021-01-17 06:39

    Assume C is an Array where n is an int or NSNumber type caste to int

    for(n in C){

    if{n equal to 10)

    dostuff }

    else{ doOtherStuff } }

    }

    The good thing about this approach you can inore the size of the Array.

    Look at the docs for Enumeration Glass

提交回复
热议问题