<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: 图像与缓存</title>
	<atom:link href="http://www.iphone-geek.cn/%e7%bc%96%e7%a8%8b/%e5%9b%be%e5%83%8f%e4%b8%8e%e7%bc%93%e5%ad%98/feed" rel="self" type="application/rss+xml" />
	<link>http://www.iphone-geek.cn/%e7%bc%96%e7%a8%8b/%e5%9b%be%e5%83%8f%e4%b8%8e%e7%bc%93%e5%ad%98</link>
	<description>iPhone 新闻，编程，技巧与提示，代码，教程</description>
	<lastBuildDate>Tue, 07 Feb 2012 09:36:03 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: bagusflyer</title>
		<link>http://www.iphone-geek.cn/%e7%bc%96%e7%a8%8b/%e5%9b%be%e5%83%8f%e4%b8%8e%e7%bc%93%e5%ad%98/comment-page-1#comment-166</link>
		<dc:creator>bagusflyer</dc:creator>
		<pubDate>Mon, 29 Mar 2010 04:25:28 +0000</pubDate>
		<guid isPermaLink="false">http://iphonegeek.zuesitech.com/?p=156#comment-166</guid>
		<description>你说的没错，imageWithContentsOfFile 就是使用lazy loading，在使用时才加载。比如说通常情况下，你会在一个ImageView中使用它，例如：
&lt;p&gt;&#160;&lt;/p&gt;
[cc lang=&quot;objc&quot;]
UIImageView* image =[[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:imagepath]];
[/cc]
&lt;p&gt;&#160;&lt;/p&gt;
当你释放UIImageView时，自然就没有使用到，它就会被释放掉。重点是，如果你是使用imageNamed来加载图像时，即使你释放掉UIImageView，图像仍然保存在缓存中。</description>
		<content:encoded><![CDATA[<p>你说的没错，imageWithContentsOfFile 就是使用lazy loading，在使用时才加载。比如说通常情况下，你会在一个ImageView中使用它，例如：</p>
<p>&nbsp;</p>
<div class="codecolorer-container objc mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">UIImageView<span style="color: #002200;">*</span> image <span style="color: #002200;">=</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIImageView alloc<span style="color: #002200;">&#93;</span> initWithImage<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>UIImage imageWithContentsOfFile<span style="color: #002200;">:</span>imagepath<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;</div></td></tr></tbody></table></div>
<p>&nbsp;</p>
<p>当你释放UIImageView时，自然就没有使用到，它就会被释放掉。重点是，如果你是使用imageNamed来加载图像时，即使你释放掉UIImageView，图像仍然保存在缓存中。</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Forrest</title>
		<link>http://www.iphone-geek.cn/%e7%bc%96%e7%a8%8b/%e5%9b%be%e5%83%8f%e4%b8%8e%e7%bc%93%e5%ad%98/comment-page-1#comment-165</link>
		<dc:creator>Forrest</dc:creator>
		<pubDate>Fri, 26 Mar 2010 01:48:12 +0000</pubDate>
		<guid isPermaLink="false">http://iphonegeek.zuesitech.com/?p=156#comment-165</guid>
		<description>imageWithContentsOfFile 就相当是lazy loading 的概念，用到的时候，才去申请内存，那么，第一次用到是如此，第二次呢，后面呢？

是不是第一次用到后，发现不用了，就释放掉 ？ 估计不可能这么聪明。

欢迎探讨： skype   forrest.shi</description>
		<content:encoded><![CDATA[<p>imageWithContentsOfFile 就相当是lazy loading 的概念，用到的时候，才去申请内存，那么，第一次用到是如此，第二次呢，后面呢？</p>
<p>是不是第一次用到后，发现不用了，就释放掉 ？ 估计不可能这么聪明。</p>
<p>欢迎探讨： skype   forrest.shi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 花太香齐</title>
		<link>http://www.iphone-geek.cn/%e7%bc%96%e7%a8%8b/%e5%9b%be%e5%83%8f%e4%b8%8e%e7%bc%93%e5%ad%98/comment-page-1#comment-161</link>
		<dc:creator>花太香齐</dc:creator>
		<pubDate>Wed, 24 Mar 2010 09:21:34 +0000</pubDate>
		<guid isPermaLink="false">http://iphonegeek.zuesitech.com/?p=156#comment-161</guid>
		<description>老衲花太香齐到此观光，嘎嘎</description>
		<content:encoded><![CDATA[<p>老衲花太香齐到此观光，嘎嘎</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hanyegudeng</title>
		<link>http://www.iphone-geek.cn/%e7%bc%96%e7%a8%8b/%e5%9b%be%e5%83%8f%e4%b8%8e%e7%bc%93%e5%ad%98/comment-page-1#comment-8</link>
		<dc:creator>hanyegudeng</dc:creator>
		<pubDate>Thu, 12 Nov 2009 01:59:50 +0000</pubDate>
		<guid isPermaLink="false">http://iphonegeek.zuesitech.com/?p=156#comment-8</guid>
		<description>呵呵，俺hanyegudeng就紧随其后了！！！</description>
		<content:encoded><![CDATA[<p>呵呵，俺hanyegudeng就紧随其后了！！！</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cclv lvyile@cocoachina.com</title>
		<link>http://www.iphone-geek.cn/%e7%bc%96%e7%a8%8b/%e5%9b%be%e5%83%8f%e4%b8%8e%e7%bc%93%e5%ad%98/comment-page-1#comment-4</link>
		<dc:creator>cclv lvyile@cocoachina.com</dc:creator>
		<pubDate>Wed, 11 Nov 2009 12:56:58 +0000</pubDate>
		<guid isPermaLink="false">http://iphonegeek.zuesitech.com/?p=156#comment-4</guid>
		<description>小僧cclv特来拜访 :)</description>
		<content:encoded><![CDATA[<p>小僧cclv特来拜访 <img src='http://www.iphone-geek.cn/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

