我必須在NSMutableArray
中緩存一些UIImageView
,但是當我進入這個數組時總是空的。NSArray中的UIImageView
我用這個代碼:
NSMutableArray *currentImages = [[NSMutableArray alloc] init];
UIImageView *imageV = [[UIImageView alloc]initWithFrame:CGRectMake(20, 8, 50, 50)];
for (int i = 0; i< 20; i++) {
imageV.image = [UIImage imageNamed:@"defaut.png"];
[currentImages addObject:imageV];
}
你能幫助我嗎?
您需要展示更多代碼。你在哪裏存儲'currentImages'?你爲什麼要將圖像視圖存儲在數組中?這是你的真實代碼嗎? – Wain