Im trying to add some subviews to a container (container is a NSView derived class, and subviews are some NSImageView objects). Since the code is messy right now due to trying different stuff, i wont paste it all for the time being.
This is the part where i add the subviews:
NSImage *tileImage;
tileImage = [[NSImage alloc] initWithContentsOfFile:[textures objectAtIndex:i]];
NSImageView *imageView;
imageView = [[NSImageView alloc] init];
[imageView setImage:tileImage];
[self addSubview:imageView];
NSRunInformationalAlertPanel(@"Count subviews", [NSString stringWithFormat:@"%d",[[self subviews] count]], @"OK", NULL, NULL);
[self setNeedsDisplay:TRUE];
The NSRunInformation... displays 18 (this is the correct number of files im loading). The images are ok, i was displaying them before this directly into the container view.
As i was saying, the problem is nothing is displayed after loading. Maybe i must do something else?
Im using the sample code COCOASLIDES from Apple for guidance , initially i was trying to load a more complex subview (using a custom xib created in Interface Builder),but that also failed (nothing showing).
Maybe someone could point out some hints, some guidelines. Thanks.
IMPORTANT: I've asked a new question (related to this one, but more detailed and with source code) on the subject, so everyone who would like to help please check this question:
New question
THANKS!