2

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?

TechZen
  • 64,370
  • 15
  • 118
  • 145
Favo Yang
  • 194
  • 3
  • 13

1 Answers1

0

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

Cœur
  • 37,241
  • 25
  • 195
  • 267
Vladimir
  • 170,431
  • 36
  • 387
  • 313
  • Whenever I hear "image caching" on the iPhone, I think of "`imageNamed:`". – Dimitris Feb 10 '10 at 12:45
  • exactly, it may use some similar private methods though, but technically it must be similar to imageNamed – Vladimir Feb 10 '10 at 12:53
  • 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 Feb 12 '10 at 14:44