Question: ```
UIImageView *mooshinLogo = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mooshin.png"]];

```

I'm not sure if im instantiating my image correctly because i've been reading that imageNamed will not be emptied from the cache and should only be used for buttons and small icons. What about background images, and image galleries?

How do I implement UIImageView the right way?

Answer: 
`imageNamed:` method caches images that you load. In case of low memory conditions or memory warning that cache will be emptied.

If you want to show images in gallery it is better to use `imageWithContentsOfFile:` method as it doesn't cache the data.

In case of very big images you should use `CATiledLayer` to display your image using tiles.
Others above are right about imageNamed keeps a cache of these images. This is especially true when using NIB files. Releasing a Viewcontroller with ImageViews on them doesn't directly release the associated images.

I had an app that had lots of images with lots of pages in a navigation controller. Eventually it would crash when only using imageNamed method. So, I now use (found here on SO) and over:

```
+ (UIImage *)imageNamed:(NSString *)name {
    //NSLog(@"ImageNamed: %@", name);
    return [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:name ofType:nil]];
}

```

Now I can control when I want to remove an image and and make it actually clear from memory. The aforementioned app, I would actually load the images on viewDidLoad and remove them on viewDidDisappear. So, when I was 10-15 pages deep in the NavController, I could keep memory down.