【发布时间】:2011-09-26 21:32:18
【问题描述】:
enter code hereint quantity = [array count];
int i;
for (i=0; i<quantity; i++)
{
NSString *imageName = [NSString stringWithFormat:@"Car_%@.jpg", [[array objectAtIndex:i] objectForKey:@"CarName"]] ];
UIImage *img[i] = [UIImage imageNamed:imageName];
UIImageView *imgView[i] = [[UIImageView alloc] initWithImage:img[i]];
imgView[i].frame = CGRectMake(i*kWidth, 0, kWidth, kHeight);
[scrollView addSubview:imgView[i]];
[imgView[i] release];
}`enter code here`
错误:可变大小的对象可能未初始化。但为什么呢?
【问题讨论】: