views:

262

answers:

1

After reading the memory management for UIImage, I'm worried about how interface builder loads an UIImage. Does it use UIImage:imagedNamed or UIImage:imageWithData?

A: 

See relevant section in "Resource Programming Guide":

When you load a nib file that contains references to image and sound resources, the nib-loading code caches resources whenever possible for easy retrieval later. For example, after loading a nib file, you can retrieve an image associated with that nib file using the imageNamed: method of either NSImage or UIImage (depending on your platform).

So it looks like it uses imageNamed: or some underlying internal routines.
Edit: You may also be interested in this post about +imageNamed

Vladimir
Whenever I hear "image caching" on the iPhone, I think of "`imageNamed:`".
Dimitris
exactly, it may use some similar private methods though, but technically it must be similar to imageNamed
Vladimir
I see, that's a trouble for me. I'm trying to avoid use imageNamed, since memory is very sensitive for my app. I have to load image in viewDidLoad, but that make IB not that useful for a layout tools as before.
Favo Yang