I created two UIImageView *image1 and *image2, after I created a NSMutableArray *arrayImage, now I want fill this array
arrayImage = [[NSMutableArray alloc] initWithObjects: image1, image2, nil];
but I created UIImageView and NSMutableArray in a ClassA but I want fill the NSMutableArray in the viewdidload in .m of ClassB, then Xcode tell me that image1 and image2 are undeclared. I just used property and synthesize. What can I do?
You can try something like this, you have to keep a reference to classB inside classA so that when you want to add a view to array in classB you can access classB’s properties through classA’s clasB property. Try something like this.