本帖最后由 UT丶 于 2014-5-10 17:30 编辑
- //初始化一个数组
- NSArray *weekArray = [NSArray arrayWithObjects:@"一",@"二", @"三",@"四",nil];
-
-
- for (int i = 0; i < [weekArray count]; i++) {
-
- NSLog(@"i %@",[weekArray objectAtIndex:i]);
- }
复制代码- //可变数组
- NSMutableArray *weekNsmArray = [[NSMutableArray alloc] initWithCapacity:3];
- //可以插入超过规定个数的字符串
- [weekNsmArray addObject:@"1"];
- [weekNsmArray addObject:@"2"];
- [weekNsmArray addObject:@"3"];
- [weekNsmArray addObject:@"4"];
-
- for (int i = 0; i < [weekNsmArray count]; i++) {
- NSLog(@"%@",[weekNsmArray objectAtIndex:i]);
- }
复制代码
请问一下这里的i 是指什么? 可变数组是否跟不可变的i是一个性质那?
|
|