• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Newbe trying to display images in a while loop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Newbe trying to display images in a while loop
      • From: Wain <email@hidden>
  • Prev by Date: Re: One pixel wide bezier path
  • Next by Date: Re: Objects cross calls
  • Previous by thread: Installed CHUD_4.3.1, still no headers?
  • Next by thread: Re: Newbe trying to display images in a while loop
  • Index(es):
    • Date
    • Thread