Newbe trying to display images in a while loop
Newbe trying to display images in a while loop
- Subject: Newbe trying to display images in a while loop
- From: Terry Heaford <email@hidden>
- Date: Wed, 25 Jan 2006 21:35:20 +0000
I am new to this cocoa lark and have been trying to display a series
of images in a custom ImageView.
A code snippet follows:
int startNum,endNum ;
int myNum = [libraryData currentImageNum];
int librarySize = [libraryData librarySize];
NSImage *image;
NSString *filePath;
NSLog(@"librarySize = %d",librarySize);
startNum = myNum;
endNum = librarySize-1;
while (startNum <= endNum)
{
filePath =[libraryData imagePathFromNum:startNum];
NSLog(@"thefilepath = %@",filePath);
image = [[NSImage alloc] initWithContentsOfFile: filePath];
[myImageView setOpacity:1.0];
[myImageView setImage:image];
[image release];
startNum++;
}
All the variables seem to initialise correctly but when it runs
through the loop it displays filePath in the log but only displays
the final image in myImageView.
I am unclear what I am doing wrong. Can someone help please.
TIA
Terry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden