I have an NSMutableArray, called myArray. No matter what I do, the objects in it won't respond to any command. Take a look at this code:
The above code works perfectly, a UIImageVIew is created in the top left corner of the screen. However, look at this code:
With this code, no ImageVIew appears. I've been having trouble for so long with Arrays, it's like when an object is in an array it becomes invisible and unusable.
Code:
UIImageView *myView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"pic.jpg"]];
myView.frame = CGRectMake(0,0,100,100);
[self.view addSubview:myView];
[myView release];
Code:
UIImageView *myView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"pic.jpg"]];
myView.frame = CGRectMake(0,0,100,100);
[myArray replaceObjectAtIndex:0 withObject:myView];
[self.view addSubview:[myArray objectAtIndex:0]];
[myView release];