UIImageViewの複数のインスタンスをNSMutableDictionar(ies)のNSMutableArrayに追加しようとしています。
これを行っているのは、UIImageView参照に戻って引き出し、これらの画像の位置を変更できるようにするためです。
辞書から情報を引き出すと、nullポインタしか返さないようです...
これをどのように実装すべきかについての提案はありますか?n個の画像のリストを保存し、後でそれらを参照できるようにするためのより簡単な方法があるかもしれません。
// (for i = 0 to 30)
UIImageView *newBall = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ball.png"]];
newBall.center = CGPointMake (arc4random() % 280 + 20, arc4random() % 440 + 20);
[self.view addSubview:newBall];
NSMutableDictionary *dictBall = [[[NSMutableDictionary alloc] init] autorelease];
[dictBall setValue:newBall forKey:@"imgBall"];
// the dictionary is then added to the array
[newBall release];
// end for loop
(私は辞書を使用しています。これは、移動の変化率のdy / dx値も保存しているためです)