循环遍历NSArray objectAtIndex

Jos*_*ane 3 iphone object objective-c nsarray

NSInteger*count = [monLessonArrayA count]; for(i = 0; i <count; i ++){arrayVar = [monLessonArrayA objectAtIndex:i]; }

我得到一个错误,说我是未申报的,我怎么能将objectAtIndex设置为i所以我可以循环增加它每次?

谢谢.

Cal*_*vin 7

因为你的未申报.

for (int i = 0; i < count; i++)
Run Code Online (Sandbox Code Playgroud)

此外,你不需要*为你的NSInteger.

NSInteger count = [monLessonArrayA count]; 
Run Code Online (Sandbox Code Playgroud)