I'm coming in on the middle of this so I don't know if what's already been discussed. How many -unique- images are there? If you're working with a relatively small number of images, you could just cache a single copy of each and then supply the correct image for a particular cell.

If you have image versions that are otherwise identical except for, say, a different background, you could reduce your image requirements to a smaller number of images with a common graphical piece and then one image for each background. Then when you draw, draw a background image then draw the common image on top.

If you really do have a larger number of images, you might be able to get away with either replacing them with a single larger image that has all of the smaller images laid out in a grid, then just draw a portion of that image; or creating a NSBitmapImageRep big enough to hold all the images, making it the current graphics context, drawing the smaller images into it, then draw a portion of the image.

If other solutions won't work to reduce your memory footprint, you may need to reduce the number of images you're working with. Just one of the hazards of working with a small-memory (relatively) device...

steve


On Mar 7, 2009, at 10:35 AM, James Cicenia wrote:

Unfortunately they are not sequential.

They are a graphical calendar with two images per month. They can exist, they can be yellow or they can be green.
So, unfortunately, I can't do that.
:-(


On Mar 7, 2009, at 12:28 PM, David Duncan wrote:

On Mar 7, 2009, at 10:22 AM, James Cicenia wrote:

I am creating a visual indicator.
There can be approximately up to 400 rows.
Each row can have up to 24 little images.


I imagine those images are pretty small if you can fit 24 of them across the screen...

If the images are always displayed in the same order, then the simplest method might be something like this: Create a single image with all of your little images side by side in the correct order
Create a UITableView
For each UITableViewCell, embed a single opaque UIImageView.
Assign the indicator UIImage as the content of that UIImageView
Size the UIImageView to expose the number of indicators you desire and set its contentMode to UIViewContentModeLeft.

If the indicators can appear in any order, you probably would still want to do this in a UITableView, but you probably have more work.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to