Objective c For循环中没有增量

Objective c For循环中没有增量,objective-c,for-loop,increment,Objective C,For Loop,Increment,我有一个看起来很简单的问题,但出了点问题 我使用for循环和int变量nForCount进行初始化、条件和增量 我预计nForCount在每次循环后都会增加1。 但它甚至没有初始化为0。在控制台中,nForCount不显示任何内容。见图 我的代码: int nForCount = 0; int vlFilesOriginal = 100; for (nForCount = 0; nForCount < vlFilesOriginal; nForCount++) { pri

我有一个看起来很简单的问题,但出了点问题

我使用for循环和int变量nForCount进行初始化、条件和增量

我预计nForCount在每次循环后都会增加1。 但它甚至没有初始化为0。在控制台中,nForCount不显示任何内容。见图

我的代码:

int nForCount   = 0;
int vlFilesOriginal = 100;

for (nForCount = 0; nForCount < vlFilesOriginal; nForCount++) {

    printf("AppDelegate/refreshDRPopsWrapper•987: %03i \n",nForCount);

}
int nForCount=0;
int=100;
for(nForCount=0;nForCount
您只需在for循环语句中声明迭代变量。
试试这个:

int vlFilesOriginal = 100;

for (int nForCount = 0; nForCount < vlFilesOriginal; nForCount++) {

    printf("AppDelegate/refreshDRPopsWrapper•987: %03i \n",nForCount);

}
int=100;
对于(int-nForCount=0;nForCount
如果您希望导出nForCount,可以尝试

int exportedValue = 0
int vlFilesOriginal = 100;

    for (int nForCount = 0; nForCount < vlFilesOriginal; nForCount++) {

        printf("AppDelegate/refreshDRPopsWrapper•987: %03i \n",nForCount);
        exportedValue = nForCount
    }
int exportedValue=0
int=100;
对于(int-nForCount=0;nForCount
这是我一开始所拥有的。然后,我在循环外部进行切换和初始化。到目前为止,我已经做了很多for循环,还没有遇到任何问题,为什么是现在?我不明白。我将类型改为NSUInteger,现在它正在递增。这不是代码,请告诉我们如何以及在何处声明nForCount,vlfiles原始。您的示例代码运行良好。。。