<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">博客园_wtq</title><subtitle type="text"/><id>http://feed.cnblogs.com/blog/u/61656/rss</id><updated>2012-05-22T00:57:42Z</updated><author><name>wtq</name><uri>http://www.cnblogs.com/85538649/</uri></author><generator>feed.cnblogs.com</generator><link rel="alternate" type="text/html" href="http://www.cnblogs.com/85538649/"/><link rel="self" type="application/atom+xml" href="http://feed.cnblogs.com/blog/u/61656/rss"/><entry><id>http://www.cnblogs.com/85538649/archive/2012/05/21/2512085.html</id><title type="text">iphone  ipad  无法进行真机调试</title><summary type="text">问题：在做真机调试时，证书安装正常，但是无法将程序运行到ipad上。 在选择模拟器时，显示如下图所示。 下载附件(12.8 KB)4小时前上传 此图的iOS Device并没有消失。此时无法将程序运行到ipad上进行调试。 当我把另外一台ipad连接到电脑上，结果iOS Device消失了。此时，可以将程序运行到ipad上。请问这是为什么？解决方法：原因是设备的版本与xcode的版本不一致，比如iphone3GS需要设置Deployment Target的值为4.0 ~4.3.而不是设置5.1</summary><published>2012-05-21T11:18:00Z</published><updated>2012-05-21T11:18:00Z</updated><author><name>wtq</name><uri>http://www.cnblogs.com/85538649/</uri></author><link rel="alternate" href="http://www.cnblogs.com/85538649/archive/2012/05/21/2512085.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/85538649/archive/2012/05/21/2512085.html"/><content type="html">&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Microsoft Yahei', Simsun, Tahoma; font-size: 12px; background-color: #ffffff; "&gt;&lt;table cellspacing="0" cellpadding="0" style="word-wrap: break-word; empty-cells: show; border-collapse: collapse; table-layout: fixed; width: 688px; "&gt;&lt;tbody style="word-wrap: break-word; "&gt;&lt;tr style="word-wrap: break-word; "&gt;&lt;td class="t_f" id="postmessage_723394" style="word-wrap: break-word; font-size: 14px; line-height: 28px; "&gt;问题：在做真机调试时，证书安装正常，但是无法将程序运行到ipad上。&lt;br style="word-wrap: break-word; " /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;在选择模拟器时，显示如下图所示。&lt;br style="word-wrap: break-word; " /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;img src="http://images.cnblogs.com/cnblogs_com/85538649/aaaa.jpg" alt="" /&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Tahoma, Helvetica, sans-serif; font-size: 10px; line-height: 28px; -webkit-text-size-adjust: none; background-color: #fefee9; "&gt;&lt;a href="http://www.devdiv.com/forum.php?mod=attachment&amp;amp;aid=MzEzMjB8NjlkNjAwZWF8MTMzNzU5ODU0MnwxNDQzMDB8MTI1MDA4&amp;amp;nothumb=yes" title="aaa.jpg 下载次数:0" target="_blank" style="word-wrap: break-word; color: #222222; text-decoration: underline; "&gt;&lt;strong style="color: #222222; text-decoration: underline; word-wrap: break-word; font-weight: 700; "&gt;下载附件&lt;/strong&gt;&lt;font class="Apple-style-span" color="#222222"&gt;&amp;nbsp;&lt;/font&gt;&lt;span class="xs0" style="color: #222222; text-decoration: underline; word-wrap: break-word; font-family: Tahoma, Helvetica, sans-serif; font-size: 0.83em; -webkit-text-size-adjust: none; "&gt;(12.8 KB)&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #444444; font-family: 'Microsoft Yahei', Simsun, Tahoma; font-size: 12px; background-color: #ffffff; "&gt;&lt;table cellspacing="0" cellpadding="0" style="word-wrap: break-word; empty-cells: show; border-collapse: collapse; table-layout: fixed; width: 688px; "&gt;&lt;tbody style="word-wrap: break-word; "&gt;&lt;tr style="word-wrap: break-word; "&gt;&lt;td class="t_f" style="word-wrap: break-word; font-size: 14px; line-height: 28px; "&gt;&lt;ignore_js_op style="word-wrap: break-word; "&gt;&lt;div class="tip tip_4 aimg_tip" id="aimg_31320_menu" initialized="true" style="word-wrap: break-word; position: absolute; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; width: 260px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #fefee9; margin-top: 0px; z-index: 301; left: 267px; top: 220px; "&gt;&lt;div class="tip_c xs0" style="word-wrap: break-word; font-family: Tahoma, Helvetica, sans-serif; font-size: 0.83em; -webkit-text-size-adjust: none; "&gt;&lt;div class="y" style="word-wrap: break-word; float: right; "&gt;&lt;span title="2012-5-21 14:18:48" style="word-wrap: break-word; "&gt;4&amp;nbsp;小时前&lt;/span&gt;&amp;nbsp;上传&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/ignore_js_op&gt;&lt;br style="word-wrap: break-word; " /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;此图的iOS Device并没有消失。此时无法将程序运行到ipad上进行调试。&lt;br style="word-wrap: break-word; " /&gt;&lt;br style="word-wrap: break-word; " /&gt;&lt;br style="word-wrap: break-word; " /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;当我把另外一台ipad连接到电脑上，结果iOS Device消失了。此时，可以将程序运行到ipad上。&lt;br style="word-wrap: break-word; " /&gt;&lt;br style="word-wrap: break-word; " /&gt;&lt;p&gt;请问这是为什么？&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;解决方法：原因是设备的版本与xcode的版本不一致，比如iphone3GS需要设置Deployment Target的值为4.0 ~4.3.而不是设置5.1&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;&amp;nbsp;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/85538649/aggbug/2512085.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/85538649/archive/2012/05/21/2512085.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/85538649/archive/2012/05/21/2511594.html</id><title type="text">mac 截图快捷键</title><summary type="text">原文地址：http://blog.renren.com/share/249701602/5160559368有些人说我废话很多= =来个总结Shift+Command+3  截取全屏幕至桌面Shift+Command+Control+3  截取全屏幕至剪贴板Shift+Command+4  截取部分屏幕至桌面Shift+Command+Control+4  截取部分屏幕至剪贴板Shift+Command+4 然后 空格 Space  截取窗口或原件至桌面Shift+Command+Control+4 然后 空格 Space 截取窗口或原件至剪贴板Shift+Command+4 然后</summary><published>2012-05-21T06:31:00Z</published><updated>2012-05-21T06:31:00Z</updated><author><name>wtq</name><uri>http://www.cnblogs.com/85538649/</uri></author><link rel="alternate" href="http://www.cnblogs.com/85538649/archive/2012/05/21/2511594.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/85538649/archive/2012/05/21/2511594.html"/><content type="html">&lt;font class="Apple-style-span" face="Tahoma, Verdana, STHeiTi, simsun, sans-serif"&gt;&lt;span class="Apple-style-span" style="line-height: 22px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;span class="Apple-style-span" style="color: #333333; font-family: Tahoma, Verdana, STHeiTi, simsun, sans-serif; font-size: 14px; line-height: 22px; background-color: #ffffff; "&gt;&lt;p&gt;&amp;nbsp;原文地址：&lt;div style="display: inline-block; "&gt;&lt;/div&gt;&lt;/p&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #333333; font-family: Tahoma, Verdana, STHeiTi, simsun, sans-serif; line-height: 22px; background-color: #ffffff; "&gt;&lt;a href="http://blog.renren.com/share/249701602/5160559368"&gt;http://blog.renren.com/share/249701602/5160559368&lt;/a&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #333333; font-family: Tahoma, Verdana, STHeiTi, simsun, sans-serif; font-size: 14px; line-height: 22px; background-color: #ffffff; "&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;有些人说我废话很多= =来个总结&lt;/p&gt;&lt;p&gt;Shift&lt;img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_shift.gif" alt="" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; vertical-align: middle; max-width: 550px; float: none; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; " /&gt;+Command&lt;img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_command.gif" alt="" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; vertical-align: middle; max-width: 550px; float: none; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; " /&gt;+3  截取全屏幕至桌面&lt;/p&gt;&lt;p&gt;Shift&lt;img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_shift.gif" alt="" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; vertical-align: middle; max-width: 550px; float: none; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; " /&gt;+Command&lt;img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_command.gif" alt="" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; vertical-align: middle; max-width: 550px; float: none; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; " /&gt;+Control&lt;img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_control.gif" alt="" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; vertical-align: middle; max-width: 550px; float: none; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; " /&gt;+3  截取全屏幕至剪贴板&lt;/p&gt;&lt;p&gt;Shift&lt;img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_shift.gif" alt="" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; vertical-align: middle; max-width: 550px; float: none; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; " /&gt;+Command&lt;img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_command.gif" alt="" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; vertical-align: middle; max-width: 550px; float: none; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; " /&gt;+4  截取部分屏幕至桌面&lt;/p&gt;&lt;p&gt;Shift&lt;img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_shift.gif" alt="" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; vertical-align: middle; max-width: 550px; float: none; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; " /&gt;+Command&lt;img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_command.gif" alt="" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; vertical-align: middle; max-width: 550px; float: none; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; " /&gt;+Control&lt;img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_control.gif" alt="" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; vertical-align: middle; max-width: 550px; float: none; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; " /&gt;+4  截取部分屏幕至剪贴板&lt;/p&gt;&lt;p&gt;Shift&lt;img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_shift.gif" alt="" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; vertical-align: middle; max-width: 550px; float: none; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; " /&gt;+Command&lt;img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_command.gif" alt="" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; vertical-align: middle; max-width: 550px; float: none; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; " /&gt;+4 然后 空格 Space  截取窗口或原件至桌面&lt;/p&gt;&lt;p&gt;Shift&lt;img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_shift.gif" alt="" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; vertical-align: middle; max-width: 550px; float: none; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; " /&gt;+Command&lt;img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_command.gif" alt="" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; vertical-align: middle; max-width: 550px; float: none; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; " /&gt;+Control&lt;img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_control.gif" alt="" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; vertical-align: middle; max-width: 550px; float: none; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; " /&gt;+4 然后 空格 Space&amp;nbsp; 截取窗口或原件至剪贴板&lt;/p&gt;&lt;p&gt;Shift&lt;img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_shift.gif" alt="" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; vertical-align: middle; max-width: 550px; float: none; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; " /&gt;+Command&lt;img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_command.gif" alt="" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; vertical-align: middle; max-width: 550px; float: none; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; " /&gt;+4 然后 Esc  退出截屏&lt;/p&gt;&lt;p&gt;Shift&lt;img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_shift.gif" alt="" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; vertical-align: middle; max-width: 550px; float: none; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; " /&gt;+Command&lt;img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_command.gif" alt="" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; vertical-align: middle; max-width: 550px; float: none; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; " /&gt;+4 拉出选框 然后 空格 Space  移动选框&lt;/p&gt;&lt;p&gt;Shift&lt;img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_shift.gif" alt="" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; vertical-align: middle; max-width: 550px; float: none; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; " /&gt;+Command&lt;img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_command.gif" alt="" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; vertical-align: middle; max-width: 550px; float: none; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; " /&gt;+4 然后 Shift&lt;img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_shift.gif" alt="" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; vertical-align: middle; max-width: 550px; float: none; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; " /&gt;&amp;nbsp; 保持选框高度（宽度），修改宽度（高度）&lt;/p&gt;&lt;p&gt;Shift&lt;img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_shift.gif" alt="" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; vertical-align: middle; max-width: 550px; float: none; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; " /&gt;+Command&lt;img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_command.gif" alt="" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; vertical-align: middle; max-width: 550px; float: none; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; " /&gt;+4 然后&amp;nbsp;Option&lt;img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_option.gif" alt="" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-style: initial; border-color: initial; vertical-align: middle; max-width: 550px; float: none; margin-top: 0px; margin-right: 10px; margin-bottom: 10px; margin-left: 0px; " /&gt;&amp;nbsp; 保持选框中心，修改半径&lt;/p&gt;&lt;/span&gt;&lt;img src="http://www.cnblogs.com/85538649/aggbug/2511594.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/85538649/archive/2012/05/21/2511594.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/85538649/archive/2012/05/21/2511308.html</id><title type="text">ios  应用程序证书安装以及发布</title><summary type="text">原文摘自：http://www.cocoachina.com/bbs/read.php?tid-7923-keyword-%C8%E7%BA%CE%C1%AA%BB%FA%B5%F7%CA%D4.htmlhttp://developer.apple.com/iphone/index.action如果已经购买了99$, 登录进去后会看到如下地方(图1)点进去会看到如下界面(图2)这里我要提一下，公司和个人的$99Team里面的内容是有所不同的(至少我发现有不同)公司的Team下面可以加入Member而个人的不能加入Member只能是一个人，不过这里并无大碍，不妨碍我们下面的内容。点击进入 Cer</summary><published>2012-05-21T02:48:00Z</published><updated>2012-05-21T02:48:00Z</updated><author><name>wtq</name><uri>http://www.cnblogs.com/85538649/</uri></author><link rel="alternate" href="http://www.cnblogs.com/85538649/archive/2012/05/21/2511308.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/85538649/archive/2012/05/21/2511308.html"/><content type="html">&lt;p&gt;原文摘自：&lt;a href="http://www.cocoachina.com/bbs/read.php?tid-7923-keyword-%C8%E7%BA%CE%C1%AA%BB%FA%B5%F7%CA%D4.html"&gt;http://www.cocoachina.com/bbs/read.php?tid-7923-keyword-%C8%E7%BA%CE%C1%AA%BB%FA%B5%F7%CA%D4.html&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="color: #333333; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, sans-serif; line-height: 24px; background-color: #ffffff; "&gt;&lt;a href="http://developer.apple.com/iphone/index.action" target="_blank" id="url_1" style="outline-style: none; outline-width: initial; outline-color: initial; text-decoration: none; color: #0070af; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;http://developer.apple.com/iphone/index.action&lt;/a&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;如果已经购买了99$, 登录进去后会看到如下地方(图1)&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4277" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_0e35b5c1f49cc16.jpg" border="0" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;点进去会看到如下界面(图2)&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4278" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_9c453afd83fc624.jpg" border="0" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;这里我要提一下，公司和个人的$99&amp;nbsp;&amp;nbsp;Team里面的内容是有所不同的(至少我发现有不同)&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;公司的Team下面可以加入Member&amp;nbsp;&amp;nbsp;而个人的不能加入Member只能是一个人，不过这里并无大碍，不妨碍我们下面的内容。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;点击进入 Certificates 看到如下内容(图3)&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;span id="att_4279" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_b7304a21f4b9bec.jpg" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;点击图中红色部分 会下载下来一个名字为&amp;nbsp;&amp;nbsp;AppleWWDRCA.cer&amp;nbsp;&amp;nbsp;的东西&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;这个是调试发布IPHONE 程序必须的一个东西，这个东西我们只要下载一次就够了，即使你有N个IDP，那么无论是调试程序，还是发布程序，那也只需要一个，后面我们要说到Distribution页面时，也有这个链接，如果已经下载过，那么就不用再下这个了。(最初因为对这个流程不懂，我下载了N次这个)，&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;下完之后，点击这个，这个东西就会装到自己的机器上。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;打开你的&amp;nbsp;&amp;nbsp;Keychain Access ，如果dock里面没有到 C盘 Applicati*****\Utilities下面去找Keychain Access，中文名字好像叫&amp;#8221; 钥匙串&amp;#8230;&amp;#8221; 打开这个，你会看到如下(图4)&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;span id="att_4280" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_7f27000eb527a9f.jpg" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;这代表你已经装进去了。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;下面，我们打开Keychain的这个菜单(图5)&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4281" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_7328a908abaab08.jpg" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;按着下面的图来&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;(图6)&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4282" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_25c9b317ca32d00.png" border="0" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;(图7)&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4283" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_e3067ecf51a0c85.png" border="0" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;(图8)&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4284" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_4abd4f26b378a2c.png" border="0" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;然后continute&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;就会生成一个CertificateSigningRequest.certSigningRequest 的文件，在你的桌面上哦&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;下一步(图9)：&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4285" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_7da8987289f724c.jpg" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;点击Request Certificate(图10)&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4286" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_c7dfea7c33babb1.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;点击Choose File（图11）&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;span id="att_4287" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_b82b3351d940bfa.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;选中CertificateSigningRequest.certSigningRequest&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;点击Choose（图12）&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4288" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_9d9d7aac7b207b8.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;点击Submit&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;(图13)&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4289" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_ffab68e045ad39f.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;点击Approve&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;（图14）&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4290" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_632c38283bbb008.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;这时你的证书是牌Pending的状态&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;刷新一个网页，OK就处于如下状态&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;（图15）&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4291" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_963e88021bfb7d8.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;这时点击 Download按钮，会得到一个developer_identity.cer&amp;nbsp;&amp;nbsp; 双击这个文件&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;（图16）&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4292" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_f9a9ab66c85a9a4.png" border="0" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;点击OK&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;这时再打开你的keychain 看看 会是如下结果&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;（图17）&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4293" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_6221167c2fd506d.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;切记这时能看到下面那个 钥匙 状的东西，如果没有这个，是不可能调试的，以前有时，我经常看不到那个 钥匙 状的东西&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;OK，我们继续&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;打开Devices 那一项&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;(图18)&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4294" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_c67a639d3820928.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;点击 Add Devices&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;（图19）&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4295" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_f5ba22907b919b5.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;给自己的设备取个名字例如MyIPod&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;DeviceID 就是自己IPod或IPHONE的机身号（40位），机身号的获取方法有很多，可能通过 xcode 的window-&amp;gt;Organizer 来取得&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;(图20)&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4296" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_58247de4c6b11b3.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;然后填入表中并点击summit&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图21&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4297" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_560b219ff659b5f.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;下面我们来搞APPID&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图22&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;span id="att_4298" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_5e0f1740f0d8a08.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;点击NewAppID&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图23&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4299" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_d553dd0fd09acc7.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;第一处，随便写个名字就行了， 我以AppID为例&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;第二处，一定要注意了，一定要按着这样的格式写&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;我这里写的是&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;com.abc.*&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;你也可以写成 com.xyz.*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;com.google.*&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;尽量中间那个变量有点意义，一般情况下是公司的名字。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;切记一定要写成这种格式，不然以后会有麻烦&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;然后submit&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图24&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;span id="att_4300" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_30a545246d90693.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;继续Provisioning页面&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图25&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4301" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_cf31176f3111d3c.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;点击New Profile&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;按着我的填一下&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图26&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4302" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_7b1050b3b7f9663.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;填完后 Submit&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图27&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4303" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_ef59f995f51e6da.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;Download 你会得到一个 DevProvision.mobileprovision 的文件，这个文件是要装到手机里面的&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;将这个拖动到organizer&amp;nbsp;&amp;nbsp;里面&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图28&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4304" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_3ef55c16a84bd48.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;拖动后如图29&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4305" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_7e58026939d6633.png" border="0" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;这时打开你的IPOD 你会发现在&amp;nbsp;&amp;nbsp;设置-&amp;gt;通用-&amp;gt;描述文件&amp;nbsp;&amp;nbsp;里面有个东西，那就是你的证书了&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;然后再双击DevProvision.mobileprovision这个文件，然后你的xcode 就被激活，这时查看C盘&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;Users\用户名\Library\MobileDevice\Provisioning Profiles下面 是不是有了一个&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;XXXXXX-XXXXXX-XXXXX-XXXXXX.mobileprovision的文件？&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;下面随便打开一个IPHONE的工程&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;打开那个工程的plist文件，把Bundle identifier改成如下&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图30&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4306" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_a6c6b6b3c5b2b14.png" border="0" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;现在大概你知道 abc 是什么东西了吧&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;打开这个工程的info&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图31&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4307" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_90ee028f52eea43.png" border="0" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;然后按着下图改一下设置（切记选中你该选中的那一项）&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图32&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4308" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_5a8149519c8dc2a.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;如果你想选中的那一项是灰色的，那么你前面的某些流程一定出了问题&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;然后还有一处需要确认，如下（图33）&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4309" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_3e00b6d5b47328e.png" border="0" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;请确认，红色是部分是你应该选中的&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图34&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4310" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_b8ea8ee9325d83d.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;OK&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;现在已经大功告成了 99.9999%了&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;选中Device&amp;#8230;&amp;nbsp;&amp;nbsp;Debug&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;然后 Build and Go&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图35&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4311" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_8fd995826aea47d.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;程序肯定已经跑在你的机器上了，如果不行，那么重起一下你的IPOD，如果再不行那就重起一下你的电脑，如果再再不行那就自己想办法吧&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;续&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;接着如何发布程序&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;打开Certificicates 的Distribution页面&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;（图36）&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4330" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_4dc65a82c496e2f.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;点击 Request Certificate按钮(有上面联机调试的步骤这个过程一定很熟了吧)&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;（图37）&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4331" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_96cb435eab7a6b3.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;选中CertificateSigningRequest.certSigningRequest&amp;nbsp;&amp;nbsp;文件(这个文件在联机调试的过程中已经生成过了)，&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图38&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4332" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_2fea8cbf1f72d02.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;选中然后点击Submit&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图39&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4333" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_f27bf1c7e8b892b.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;点击Appove&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图40&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4334" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_65712ea64ddafe0.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;这时需要刷新一下页面&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图41&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4335" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_21327e260cd9f64.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;点击DownLoad&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;会得到一个名为distribution_identity.cer 的文件&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;双击这个文件，会有如下提示&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图42&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4336" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_caa072654f8a7b9.png" border="0" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;点击OK&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;然后打开keychain 就会看到如下的图&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图43&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4337" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_8f66dfcd3e13744.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;这时你的电脑就已经具备发布程序的证书了&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;下面打开Provisioning 的Distribution页面&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图44&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4338" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_4723244d772d4c2.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;点击New Profile&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;然后按着下图填一下，Profile Name 随便写个名字就行了&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图45&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4339" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_160abb9f25c3029.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;然后Submit&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图46&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4340" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_d4141f35587392e.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;刷新一下&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图47&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4341" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_6c930dd2bbb56da.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;OK现在Download ，你会得到一个 Distribution.mobileprovision 的文件&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;双击这个文件，你的xcode 会被激活&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;查看C盘&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;Users\用户名\Library\MobileDevice\Provisioning Profiles下面 又多了一个&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;XXXXXX-XXXXXX-XXXXX-XXXXXX.mobileprovision的文件&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;现在我们再配置一下xcode&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图48&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4342" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_5984f0d1aaa8010.png" border="0" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;打开Configurati***** 页面&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;选中Release 然后Duplicate 一下&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图49&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4343" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_e7819b3d43af6a1.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;Duplicate之后如下图&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图50&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4344" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_5ee42dbfc1b7e7b.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;我们把名字改成Distribution&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图51&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4345" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_ed2a7ab5174d712.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;接着我们切换到Build 页面&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图52&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4346" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_c6d4ed64af47ea0.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图中1处选中Distribution&amp;nbsp;&amp;nbsp; 2处选中Distribution&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;然后&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图53&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4347" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_09afdc1077c3f2a.png" border="0" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图54&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4348" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_82fd76be5555549.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;确定图54中，是你应该选的，不然build时会出现签名错误&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;确定之后，继续&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图55&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4349" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_7567126654e0228.png" border="0" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;选中Device 和 Distribution&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;OK&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图56&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4350" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_e10eca13b748229.png" border="0" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;Build&amp;nbsp;&amp;nbsp;OK&amp;nbsp;&amp;nbsp;大功告成了99.9%了&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;这时如果有签名错误，那一定是你上面某个地方出了问题&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;成功后&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图57&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4351" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_57f17716f3f0a8a.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;其中的iHide 就是我们要上传的东西，在上传之前，我们要把他压缩成 zip 包&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;现在我们在浏览器中输入&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;itunesconnect.apple.com&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;登录一下&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图58&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4352" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_3e727b3fe31020b.png" border="0" width="700" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;进入Manage Your Applicati*****&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图59&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;nbsp;&amp;nbsp;&lt;span id="att_4353" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_955_f9b19b08ea52a63.png" border="0" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; "  alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;点击Add New Application&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&amp;#8230;&amp;#8230;&amp;#8230;&amp;#8230;&amp;#8230;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;OK了&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;后面的不说了~~~&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/85538649/aggbug/2511308.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/85538649/archive/2012/05/21/2511308.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/85538649/archive/2012/05/19/2508682.html</id><title type="text">iphone _ ipad 应用程序发布问题</title><summary type="text">问题描述： 先将一个iphone应用程序发布到appStore，然后下载到ipad上进行安装，安装一切正常，登录也正常，但是当点击摄像头节点时，却报错。 应用程序自动关闭。</summary><published>2012-05-19T02:24:00Z</published><updated>2012-05-19T02:24:00Z</updated><author><name>wtq</name><uri>http://www.cnblogs.com/85538649/</uri></author><link rel="alternate" href="http://www.cnblogs.com/85538649/archive/2012/05/19/2508682.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/85538649/archive/2012/05/19/2508682.html"/><content type="html">&lt;p&gt;问题描述：&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;先将一个iphone应用程序发布到appStore，然后下载到ipad上进行安装，安装一切正常，登录也正常，但是当点击摄像头节点时，却报错。 应用程序自动关闭。&lt;/p&gt;&lt;img src="http://www.cnblogs.com/85538649/aggbug/2508682.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/85538649/archive/2012/05/19/2508682.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/85538649/archive/2012/05/17/2505944.html</id><title type="text">Quartz 2D编程指南(1) － 概览</title><summary type="text">1：原文链接地址：http://www.cocoachina.com/bbs/read.php?tid=77731&amp;page=1Quartz 2D是一个二维图形绘制引擎，支持iOS环境和Mac OS X环境。我们可以使用Quartz 2D API来实现许多功能，如基本路径的绘制、透明度、描影、绘制阴影、透明层、颜色管理、反锯齿、PDF文档生成和PDF元数据访问。在需要的时候，Quartz 2D还可以借助图形硬件的功能。在Mac OS X中，Quartz 2D可以与其它图形图像技术混合使用，如Core Image、Core Video、OpenGL、QuickTime。例如，通过使用 Q</summary><published>2012-05-17T03:31:00Z</published><updated>2012-05-17T03:31:00Z</updated><author><name>wtq</name><uri>http://www.cnblogs.com/85538649/</uri></author><link rel="alternate" href="http://www.cnblogs.com/85538649/archive/2012/05/17/2505944.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/85538649/archive/2012/05/17/2505944.html"/><content type="html">&lt;p&gt;1：原文链接地址：&lt;a href="http://www.cocoachina.com/bbs/read.php?tid=77731&amp;amp;page=1"&gt;http://www.cocoachina.com/bbs/read.php?tid=77731&amp;amp;page=1&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="color: #333333; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, sans-serif; font-size: 14px; line-height: 28px; background-color: #ffffff; "&gt;Quartz 2D是一个二维图形绘制引擎，支持iOS环境和Mac OS X环境。我们可以使用Quartz 2D API来实现许多功能，如基本路径的绘制、透明度、描影、绘制阴影、透明层、颜色管理、反锯齿、PDF文档生成和PDF元数据访问。在需要的时候，Quartz 2D还可以借助图形硬件的功能。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;在Mac OS X中，Quartz 2D可以与其它图形图像技术混合&lt;span id="rlt_4" style="outline-style: none; outline-width: initial; outline-color: initial; cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #fa891b; "&gt;使用&lt;/span&gt;，如Core Image、Core Video、OpenGL、QuickTime。例如，通过使用 QuickTime的GraphicsImportCreateCGImage函数，可以用 Quartz从一个 QuickTime图形导入器中创建一个图像。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;Page&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;Quartz 2D在图像中使用了绘画者模型(painter&amp;#8217;s model)。在绘画者模型中，每个连续的绘制操作都是将一个绘制层(a layer of &amp;#8216;paint&amp;#8217;)放置于一个画布(&amp;#8216;canvas&amp;#8217;)，我们通常称这个画布为(Page)。 Page上的绘图可以通过额外的绘制操作来叠加更多的绘图。Page上的图形对象只能通过叠加更多的绘图来改变。这个模型允许我们使用小的图元来构建复杂的图形。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图1-1展示了绘画者模型如何工作。从图中可以看出不同的绘制顺序所产生的效果不一样。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;span id="att_30713" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_38018_a745603f3726f2d.png" border="0" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; " alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;Page可以是一张纸(如果输出设备是打印机)，也可以是虚拟的纸张(如果输出设备是PDF文件)，还可以是bitmap图像。这根据实际使用的graphics context而定。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;绘制目标：Graphics Context&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;Graphics Context是一个数据类型(CGContextRef)，用于封装Quartz绘制图像到输出设备的信息。设备可以是PDF文件、bitmap或者&lt;span id="rlt_6" style="outline-style: none; outline-width: initial; outline-color: initial; cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #fa891b; "&gt;显示&lt;/span&gt;器的窗口上。Graphics Context中的信息包括在Page中的图像的图形绘制参数和设备相关的表现形式。Quartz中所有的对象都是绘制到一个Graphics Context中。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;我们可以将Graphics Context想像成绘制目标，如图1-2所示。当用Quartz绘图时，所有设备相关的特性都包含在我们所使用的Graphics Context中。换句话说，我们可以简单地给Quartz绘图序列指定不同的Graphics Context，就可将相同的图像绘制到不同的设备上。我们不需要任何设备相关的计算；这些都由Quartz替我们完成。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;span id="att_30714" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_38018_5d057341138bdec.png" border="0" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; " alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;Quartz提供了以下几种类型的Graphics Context，详细的介绍将在后续章节说明。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 15px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: disc; list-style-position: initial; list-style-image: initial; "&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;Bitmap Graphics Context&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;PDF Graphics Context&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;Window Graphics Context&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;Layer Context&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;Post Graphics Context&lt;/li&gt;&lt;/ul&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;Quartz 2D 数据类型&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;除了 Graphics Context 之外，Quartz 2D API还定义一些数据类型。由于这些API就Core Graphics框架的一部分，所以这些数据类型都是以CG开头的。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;Quartz 2D使用这些数据类型来创建对象，通过操作这些对象来获取特定的图形。图1-3例举了三个使用Quartz 2D的绘制操作所获得的图像。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;span id="att_30715" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_38018_367596e0fcd9c36.png" border="0" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; " alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;下面列出了Quartz 2D包含的数据类型：&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;ul style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 15px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: disc; list-style-position: initial; list-style-image: initial; "&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;CGPathRef：用于向量图，可创建路径，并进行填充或描画(stroke)&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;CGImageRef：用于表示bitmap图像和基于采样数据的bitmap图像遮罩。&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;CGLayerRef：用于表示可用于重复绘制(如背景)和幕后(offscreen)绘制的绘画层&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;CGPatternRef：用于重绘图&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;CGShadingRef、CGGradientRef：用于绘制渐变&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;CGFunctionRef：用于定义回调函数，该函数包含一个随机的浮点值参数。当为阴影创建渐变时使用该类型&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;CGColorRef, CGColorSpaceRef：用于告诉Quartz如何解释颜色&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;CGImageSourceRef,CGImageDestinationRef：用于在Quartz中移入移出数据&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;CGFontRef：用于绘制文本&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;CGPDFDictionaryRef, CGPDFObjectRef, CGPDFPageRef, CGPDFStream, CGPDFStringRef, and CGPDFArrayRef：用于访问PDF的元数据&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;CGPDFScannerRef, CGPDFContentStreamRef：用于解析PDF元数据&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;CGPSConverterRef：用于将PostScript转化成PDF。在iOS中不能使用。&lt;/li&gt;&lt;/ul&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;图形状态&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;Quartz通过修改当前图形状态(current graphics state)来修改绘制操作的结果。图形状态包含用于绘制程序的参数。绘制程序根据这些绘图状态来决定如何渲染结果。例如，当你调用设置填充颜色的函数时，你将改变存储在当前绘图状态中的颜色值。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;Graphics Context包含一个绘图状态栈。当Quartz创建一个Graphics Context时，栈为空。当保存图形状态时，Quartz将当前图形状态的一个副本压入栈中。当还原图形状态时，Quartz将栈顶的图形状态出栈。出栈的状态成为当前图形状态。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;可使用函数CGContextSaveGState来保存图形状态，CGContextRestoreGState来还原图形状态。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;注意：并不是当前绘制环境的所有方面都是图形状态的元素。如，图形状态不包含当前路径(current path)。下面列出了图形状态相关的参数：&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;ul style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 15px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: disc; list-style-position: initial; list-style-image: initial; "&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;Current transformation matrix (CTM)：当前转换矩阵&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;Clipping area：裁剪区域&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;Line: 线&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;Accuracy of curve estimation (flatness)：曲线平滑度&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;Anti-aliasing setting：反锯齿设置&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;Color: 颜色&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;Alpha value (transparency)：透明度&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;Rendering intent：渲染目标&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;Color space: 颜色空间&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;Text: 文本&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;Blend mode：混合模式&lt;/li&gt;&lt;/ul&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;Quartz 2D 坐标系统&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;坐标系统定义是被绘制到Page上的对象的位置及大小范围，如图1-4所示。我们在用户空间坐标系统(user-space coordination system，简称用户空间)中指定图形的位置及大小。坐标值是用浮点数来定义的。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;span id="att_30716" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_38018_39ca6b90ee198d0.png" border="0" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; " alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;由于不同的设备有不同的图形功能，所以图像的位置及大小依赖于设备。例如，一个显示设备可能每英寸只能显示少于96个像素，而打印机可能每英寸能显示300个像素。如果在设备级别上定义坐标系统，则在一个设备上绘制的图形无法在其它设备上正常显示。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;Quartz通过使用当前转换矩阵(current transformation matrix， CTM)将一个独立的坐标系统(user space)映射到输出设备的坐标系统(device space)，以此来解决设备依赖&lt;span id="rlt_1" style="outline-style: none; outline-width: initial; outline-color: initial; cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #fa891b; "&gt;问题&lt;/span&gt;。 CTM是一种特殊类型的矩阵(affine transform, 仿射矩阵)，通过平移(translation)、旋转(rotation)、缩放(scale)操作将点从一个坐标空间映射到另外一个坐标空间。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;CTM还有另外一个目的：允许你通过转换来决定对象如何被绘制。例如，为了绘制一个旋转了45度的盒子，我们可以在绘制盒子之前旋转Page的坐标系统。Quartz使用旋转过的坐标系统来将盒子绘制到输出设备中。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;用户空间的点用坐标对(x, y)来表示，(0, 0)表示坐标原点。Quartz中默认的坐标系统是：沿着x轴从左到右坐标值逐渐增大；沿着y轴从下到上坐标值逐渐增大。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;有一些技术在设置它们的graphics context时使用了不同于Quartz的默认坐标系统。相对于Quartz来说，这些坐标系统是修改的坐标系统(modified coordinate system)，当在这些坐标系统中显示Quartz绘制的图形时，必须进行转换。最常见的一种修改的坐标系统是原点位于左上角，而沿着y轴从上到下坐标值逐渐增大。我们可以在如下一些地方见到这种坐标系统：&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;ul style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 15px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: disc; list-style-position: initial; list-style-image: initial; "&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;在Mac OS X中，重写过isFlipped方法以返回yes的NSView类的子类&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;在IOS中，由UIView返回的绘图上下文&amp;nbsp;&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;在IOS中，通过调用UIGraphicsBeginImageContextWithOpti*****函数返回的绘图上下文&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;如果&lt;span id="rlt_2" style="outline-style: none; outline-width: initial; outline-color: initial; cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #fa891b; "&gt;应用&lt;/span&gt;程序想以相同的绘制程序在一个UIView对象和PDF Graphics Context上进行绘制，需要做一个变换以使PDF Graphics Context使用与UIView相同的坐标系。要达到这一目的，只需要对PDF的上下文的原点做一个平移(移到左上角)和用-1对y坐标值进行缩放。图1-5显示了这种变换操作：&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;span id="att_30717" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/strong&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_38018_4067d3865824e0c.png" border="0" style="outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-width: initial; border-color: initial; " alt="" /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;我们的应用程序负责调整Quartz调用以确保有一个转换应用到上下文中。例如，如果你想要一个&lt;span id="rlt_3" style="outline-style: none; outline-width: initial; outline-color: initial; cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #fa891b; "&gt;图片&lt;/span&gt;或PDF正确的绘制到一个Graphics Context中，你的应用程序可能需要临时调整Graphics Context的CTM。在IOS中，如果使用UIImage对象来包裹创建的CGImage对象，可以不需要修改CTM。UIImage将自动进行补偿以适用UIKit的坐标系统。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;table cellspacing="0" cellpadding="0" width="80%" style="outline-style: none; outline-width: initial; outline-color: initial; border-collapse: collapse; width: 1190px; "&gt;&lt;tbody style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;tr style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;td style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; word-break: break-all; word-wrap: break-word; "&gt;&lt;div class="c" style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; word-break: break-all; word-wrap: break-word; clear: both; font: normal normal normal 0px/0px Arial; overflow-x: hidden; overflow-y: hidden; height: 0px; width: 0px; "&gt;&lt;/div&gt;&lt;span class="f10 s8" style="outline-style: none; outline-width: initial; outline-color: initial; font-size: 11px; "&gt;&lt;a href="http://www.cocoachina.com/bbs/read.php?tid=77731" style="outline-style: none; outline-width: initial; outline-color: initial; text-decoration: none; color: #0070af; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;复制代码&lt;/a&gt;&lt;/span&gt;&lt;div class="blockquote2" id="code1" style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 2em; word-break: break-all; word-wrap: break-word; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-color: initial; border-top-color: #c0c0c0; border-right-color: #ededed; border-bottom-color: #ededed; border-left-color: #c0c0c0; line-height: 2em; overflow-x: hidden; overflow-y: hidden; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #ffffff; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;ol style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 1.5em; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: decimal; list-style-position: initial; list-style-image: initial; "&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 1em; padding-bottom: 0px; padding-left: 10px; list-style-type: decimal; list-style-position: initial; list-style-image: initial; border-left-width: 1px; border-left-style: solid; border-left-color: #cccccc; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; font-size: 12px; background-position: initial initial; background-repeat: initial initial; "&gt;重要：如果你打算在IOS上开发与Quartz相关的程序，了解以上所讨论的是很有用的，但不是必须的。在IOS 3.2及后续的版本中，当UIKit为你的应用程序创建一个绘图上下文时，也对上下文进行了额外的修改以匹配UIKit的约定。特别的，patterns和shadows(不被CTM影响)单独进行调整以匹配UIKit坐标系统。在这种情况下，没有一个等价的机制让CTM来转换Quartz和UIKit的上下文。我们必须认识到在什么样的上下文中进行绘制，并调整行为以匹配上下文的预期。&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;内存管理：对象所有权&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;Quartz使用Core Foundation内存管理模型(引用计数)。所以，对象的创建与销毁与通常的方式是一样的。在Quartz中，需要记住如下一些规则：&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;ul style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 15px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: disc; list-style-position: initial; list-style-image: initial; "&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;如果创建或拷贝一个对象，你将拥有它，因此你必须释放它。通常，如果使用含有&amp;#8221;Create&amp;#8221;或&amp;#8220;Copy&amp;#8221;单词的函数获取一个对象，当使用完后必须释放，否则将导致内存泄露。&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;如果使用不含有&amp;#8221;Create&amp;#8221;或&amp;#8220;Copy&amp;#8221;单词的函数获取一个对象，你将不会拥有对象的引用，不需要释放它。&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;如果你不拥有一个对象而打算保持它，则必须retain它并且在不需要时release掉。可以使用Quartz 2D的函数来指定retain和release一个对象。例如，如果创建了一个CGColorspace对象，则使用函数CGColorSpaceRetain和CGColorSpaceRelease来retain和release对象。同样，可以使用Core Foundation的CFRetain和CFRelease，但是注意不能传递NULL值给这些函数。&lt;/li&gt;&lt;/ul&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;声明：&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;1. 英文水平有限，如有翻译不当之处，请大家指出。小弟这厢有礼，定当积极改正，先&lt;span id="rlt_5" style="outline-style: none; outline-width: initial; outline-color: initial; cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #fa891b; "&gt;谢谢&lt;/span&gt;了！&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;2. 欢迎大家分享。分享时请注明出处，谢谢！&amp;nbsp;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/85538649/aggbug/2505944.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/85538649/archive/2012/05/17/2505944.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/85538649/archive/2012/05/16/2505434.html</id><title type="text">Quartz 2D编程指南(5) － 变换</title><summary type="text">Quartz2D 绘制模型定义了两种独立的坐标空间：用户空间(用于表现文档页)和设备空间(用于表现设备的本地分辨率)。用户坐标空间用浮点数表示坐标，与设备空间的像素分辨率没有关系。当我们需要一个点或者显示文档时，Quartz会将用户空间坐标系统映射到设备空间坐标系统。因此，我们不需要重写应用程序或添加额外的代码来调整应用程序的输出以适应不同的设备。我们可以通过操作CTM(current transformation matrix)来修改默认的用户空间。在创建图形上下文后，CTM是单位矩阵，我们可以使用Quartz的变换函数来修改CTM，从而修改用户空间中的绘制操作。本章内容包括：变换操作函数概</summary><published>2012-05-16T13:31:00Z</published><updated>2012-05-16T13:31:00Z</updated><author><name>wtq</name><uri>http://www.cnblogs.com/85538649/</uri></author><link rel="alternate" href="http://www.cnblogs.com/85538649/archive/2012/05/16/2505434.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/85538649/archive/2012/05/16/2505434.html"/><content type="html">&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;div style="display: inline-block; "&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Arial; line-height: 26px; background-color: #ffffff; "&gt;&lt;span style="font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, sans-serif; border-collapse: collapse; color: #333333; font-size: 14px; line-height: 24px; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;span style="color: red; outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;Quartz&lt;/span&gt;&lt;/span&gt;&amp;nbsp;2D 绘制模型定义了两种独立的坐标空间：用户空间(用于表现文档页)和设备空间(用于表现设备的本地分辨率)。用户坐标空间用浮点数表示坐标，与设备空间的像素分辨率没有关系。当我们需要一个点或者&lt;span id="rlt_6" style="outline-style: none; outline-width: initial; outline-color: initial; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #fa891b; "&gt;显示&lt;/span&gt;文档时，&amp;nbsp;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;span style="color: red; outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;Quartz&lt;/span&gt;&lt;/span&gt;会将用户空间坐标系统映射到设备空间坐标系统。因此，我们不需要重写&lt;span id="rlt_1" style="outline-style: none; outline-width: initial; outline-color: initial; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #fa891b; "&gt;应用&lt;/span&gt;程序或添加额外的&lt;span id="rlt_2" style="outline-style: none; outline-width: initial; outline-color: initial; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #fa891b; "&gt;代码&lt;/span&gt;来调整应用程序的输出以适应不同的设备。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;我们可以通过操作CTM(current transformation matrix)来修改默认的用户空间。在创建图形上下文后，CTM是单位矩阵，我们可以&lt;span id="rlt_4" style="outline-style: none; outline-width: initial; outline-color: initial; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #fa891b; "&gt;使用&lt;/span&gt;&amp;nbsp;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;span style="color: red; outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;Quartz&lt;/span&gt;&lt;/span&gt;的变换函数来修改CTM，从而修改用户空间中的绘制操作。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;本章内容包括：&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;/span&gt;&lt;ul style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 15px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: disc; list-style-position: initial; "&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;变换操作函数概览&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;如何修改CTM&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;如何创建一个仿射变换&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;如何选择两个相同的变换&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;如何获取user-to-device-space变换&lt;/li&gt;&lt;/ul&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;span style="font-size: 18px; outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;span style="color: red; outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;Quartz&lt;/span&gt;&lt;/span&gt;变换函数&lt;/span&gt;&lt;/span&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;我们可能使用&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;span style="color: red; outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;Quartz&lt;/span&gt;&lt;/span&gt;内置的变换函数方便的平移、旋转和缩放我们的绘图。只需要短短几行代码，我们便可以按顺序应用变换或结合使用变换。图5-1显示了缩放和旋转一幅&lt;span id="rlt_3" style="outline-style: none; outline-width: initial; outline-color: initial; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #fa891b; "&gt;图片&lt;/span&gt;的效果。我们使用的每个变换操作都更新了CTM。CTM总是用于表示用户空间和设备空间的当前映射关系。这种映射确保了应用程序的输出在任何显示器或打印机上看上去都很棒。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;span id="att_31344" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/span&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_38018_1a8488e54dc4575.png" border="0" alt="" style="border-width: initial; border-color: initial; outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; " /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;span style="color: red; outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;Quartz&lt;/span&gt;&lt;/span&gt;&amp;nbsp;2D API提供了5个函数，以允许我们获取和修改CTM。我们可以旋转、平移、缩放CTM。我们还可以联结一个仿射变换矩阵。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;有时我们可以不想操作用户空间，直到我们决定将变换应用到CTM时，&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;span style="color: red; outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;Quartz&lt;/span&gt;&lt;/span&gt;为此允许我们创建应用于此的仿射矩阵。我们可以使用另外一组函数来创建仿射变换，这些变换可以与CTM联结在一起。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;我们可以不需要了解矩阵的数学含义而使用这些函数。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;span style="font-size: 18px; outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;修改CTM&lt;/span&gt;&lt;/span&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;我们在绘制图像前操作CTM来旋转、缩放或平移page,从而变换我们将要绘制的对象。以变换CTM之前，我们需要保存图形状态，以便绘制后能恢复。我们同样能用仿射矩阵来联结CTM。在本节中，我们将介绍与CTM函数相关的四种操作--平移、旋转、缩放和联结。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;假设我们提供了一个可用的图形上下文、一个指向可绘制图像的矩形的指针和一个可用的CGImage对象，则下面一行代码绘制了一个图像。该行代码可以绘制如图5-2所示的图片。在阅读了本节余下的部分后，我们将看到如何将变换应用于图像。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;table cellspacing="0" cellpadding="0" width="80%"&gt;&lt;tbody style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;tr style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;td style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; word-break: break-all; word-wrap: break-word; "&gt;&lt;div class="c" style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; word-break: break-all; word-wrap: break-word; clear: both; font: normal normal normal 0px/0px Arial; overflow-x: hidden; overflow-y: hidden; height: 0px; width: 0px; "&gt;&lt;/div&gt;&lt;span class="f10 s8" style="outline-style: none; outline-width: initial; outline-color: initial; font-size: 11px; "&gt;&lt;a href="http://blog.csdn.net/cpskiss/article/details/7056276" style="color: #0070af; text-decoration: none; outline-style: none; outline-width: initial; outline-color: initial; "&gt;复制代码&lt;/a&gt;&lt;/span&gt;&lt;div class="blockquote2" id="code1"&gt;&lt;ol style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 1.5em; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: decimal; list-style-position: initial; "&gt;&lt;li&gt;CGContextDrawImage (myContext, rect, myImage);&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;span id="att_31345" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/span&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_38018_d44d391c72d79b4.png" border="0" alt="" style="border-width: initial; border-color: initial; outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; " /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;平移变换根据我们指定的x, y轴的值移动坐标系统的原点。我们通过调用CGContextTranslateCTM函数来修改每个点的x, y坐标值。如图5-3显示了一幅图片沿x轴移动了100个单位，沿y轴移动了50个单位。具体代码如下：&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;table cellspacing="0" cellpadding="0" width="80%"&gt;&lt;tbody style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;tr style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;td style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; word-break: break-all; word-wrap: break-word; "&gt;&lt;div class="c" style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; word-break: break-all; word-wrap: break-word; clear: both; font: normal normal normal 0px/0px Arial; overflow-x: hidden; overflow-y: hidden; height: 0px; width: 0px; "&gt;&lt;/div&gt;&lt;span class="f10 s8" style="outline-style: none; outline-width: initial; outline-color: initial; font-size: 11px; "&gt;&lt;a href="http://blog.csdn.net/cpskiss/article/details/7056276" style="color: #0070af; text-decoration: none; outline-style: none; outline-width: initial; outline-color: initial; "&gt;复制代码&lt;/a&gt;&lt;/span&gt;&lt;div class="blockquote2" id="code2"&gt;&lt;ol style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 1.5em; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: decimal; list-style-position: initial; "&gt;&lt;li&gt;CGContextTranslateCTM (myContext, 100, 50);&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;span id="att_31346" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/span&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_38018_a296926e60eb6bc.png" border="0" alt="" style="border-width: initial; border-color: initial; outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; " /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;旋转变换根据指定的角度来移动坐标空间。我们调用CGContextRotateCTM函数来指定旋转角度(以弧度为单位)。图5-4显示了图片以原点(左下角)为中心旋转45度，代码所下所示：&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;table cellspacing="0" cellpadding="0" width="80%"&gt;&lt;tbody style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;tr style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;td style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; word-break: break-all; word-wrap: break-word; "&gt;&lt;div class="c" style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; word-break: break-all; word-wrap: break-word; clear: both; font: normal normal normal 0px/0px Arial; overflow-x: hidden; overflow-y: hidden; height: 0px; width: 0px; "&gt;&lt;/div&gt;&lt;span class="f10 s8" style="outline-style: none; outline-width: initial; outline-color: initial; font-size: 11px; "&gt;&lt;a href="http://blog.csdn.net/cpskiss/article/details/7056276" style="color: #0070af; text-decoration: none; outline-style: none; outline-width: initial; outline-color: initial; "&gt;复制代码&lt;/a&gt;&lt;/span&gt;&lt;div class="blockquote2" id="code3"&gt;&lt;ol style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 1.5em; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: decimal; list-style-position: initial; "&gt;&lt;li&gt;CGContextRotateCTM (myContext, radians(&amp;#8211;45.));&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;span id="att_31347" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/span&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_38018_721c2428f2751db.png" border="0" alt="" style="border-width: initial; border-color: initial; outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; " /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;由于旋转操作使图片的部分区域置于上下文之外，所以区域外的部分被裁减。我们用弧度来指定旋转角度。如果需要进行旋转操作，下面的代码将会很有用&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;table cellspacing="0" cellpadding="0" width="80%"&gt;&lt;tbody style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;tr style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;td style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; word-break: break-all; word-wrap: break-word; "&gt;&lt;div class="c" style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; word-break: break-all; word-wrap: break-word; clear: both; font: normal normal normal 0px/0px Arial; overflow-x: hidden; overflow-y: hidden; height: 0px; width: 0px; "&gt;&lt;/div&gt;&lt;span class="f10 s8" style="outline-style: none; outline-width: initial; outline-color: initial; font-size: 11px; "&gt;&lt;a href="http://blog.csdn.net/cpskiss/article/details/7056276" style="color: #0070af; text-decoration: none; outline-style: none; outline-width: initial; outline-color: initial; "&gt;复制代码&lt;/a&gt;&lt;/span&gt;&lt;div class="blockquote2" id="code4"&gt;&lt;ol style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 1.5em; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: decimal; list-style-position: initial; "&gt;&lt;li&gt;#include &amp;lt;math.h&amp;gt;&lt;/li&gt;&lt;li&gt;static inline double radians (double degrees) {return degrees * M_PI/180;}&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;缩放操作根据指定的x, y因子来改变坐标空间的大小，从而放大或缩小图像。x, y因子的大小决定了新的坐标空间是否比原始坐标空间大或者小。另外，通过指定x因子为负数，可以倒转x轴，同样可以指定y因子为负数来倒转y轴。通过调用CGContextScaleCTM函数来指定x, y缩放因子。图5-5显示了指定x因子为0.5，y因子为0.75后的缩放效果。代码如下：&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;table cellspacing="0" cellpadding="0" width="80%"&gt;&lt;tbody style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;tr style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;td style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; word-break: break-all; word-wrap: break-word; "&gt;&lt;div class="c" style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; word-break: break-all; word-wrap: break-word; clear: both; font: normal normal normal 0px/0px Arial; overflow-x: hidden; overflow-y: hidden; height: 0px; width: 0px; "&gt;&lt;/div&gt;&lt;span class="f10 s8" style="outline-style: none; outline-width: initial; outline-color: initial; font-size: 11px; "&gt;&lt;a href="http://blog.csdn.net/cpskiss/article/details/7056276" style="color: #0070af; text-decoration: none; outline-style: none; outline-width: initial; outline-color: initial; "&gt;复制代码&lt;/a&gt;&lt;/span&gt;&lt;div class="blockquote2" id="code5"&gt;&lt;ol style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 1.5em; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: decimal; list-style-position: initial; "&gt;&lt;li&gt;CGContextScaleCTM (myContext, .5, .75);&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;span id="att_31348" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/span&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_38018_57869ba268aef68.png" border="0" alt="" style="border-width: initial; border-color: initial; outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; " /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;联合变换将两个矩阵相乘来联接现价变换操作。我们可以联接多个矩阵来得到一个包含所有矩阵累积效果矩阵。通过调用CGContextConcatCTM来联接CTM和仿射矩阵。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;另外一种得到累积效果的方式是执行两个或多个变换操作而不恢复图形状态。图5-6显示了先平移后旋转一幅图片的效果，代码如下：&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;table cellspacing="0" cellpadding="0" width="80%"&gt;&lt;tbody style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;tr style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;td style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; word-break: break-all; word-wrap: break-word; "&gt;&lt;div class="c" style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; word-break: break-all; word-wrap: break-word; clear: both; font: normal normal normal 0px/0px Arial; overflow-x: hidden; overflow-y: hidden; height: 0px; width: 0px; "&gt;&lt;/div&gt;&lt;span class="f10 s8" style="outline-style: none; outline-width: initial; outline-color: initial; font-size: 11px; "&gt;&lt;a href="http://blog.csdn.net/cpskiss/article/details/7056276" style="color: #0070af; text-decoration: none; outline-style: none; outline-width: initial; outline-color: initial; "&gt;复制代码&lt;/a&gt;&lt;/span&gt;&lt;div class="blockquote2" id="code6"&gt;&lt;ol style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 1.5em; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: decimal; list-style-position: initial; "&gt;&lt;li&gt;CGContextTranslateCTM (myContext, w,h);&lt;/li&gt;&lt;li&gt;CGContextRotateCTM (myContext, radians(-180.));&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;span id="att_31349" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/span&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_38018_e779ff9fd1df8b3.png" border="0" alt="" style="border-width: initial; border-color: initial; outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; " /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;图5-7显示了平移、缩放和旋转一幅图片，代码如下：&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;table cellspacing="0" cellpadding="0" width="80%"&gt;&lt;tbody style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;tr style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;td style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; word-break: break-all; word-wrap: break-word; "&gt;&lt;div class="c" style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; word-break: break-all; word-wrap: break-word; clear: both; font: normal normal normal 0px/0px Arial; overflow-x: hidden; overflow-y: hidden; height: 0px; width: 0px; "&gt;&lt;/div&gt;&lt;span class="f10 s8" style="outline-style: none; outline-width: initial; outline-color: initial; font-size: 11px; "&gt;&lt;a href="http://blog.csdn.net/cpskiss/article/details/7056276" style="color: #0070af; text-decoration: none; outline-style: none; outline-width: initial; outline-color: initial; "&gt;复制代码&lt;/a&gt;&lt;/span&gt;&lt;div class="blockquote2" id="code7"&gt;&lt;ol style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 1.5em; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: decimal; list-style-position: initial; "&gt;&lt;li&gt;CGContextTranslateCTM (myContext, w/4, 0);&lt;/li&gt;&lt;li&gt;CGContextScaleCTM (myContext, .25,&amp;nbsp; .5);&lt;/li&gt;&lt;li&gt;CGContextRotateCTM (myContext, radians ( 22.));&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;span id="att_31350" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/span&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_38018_905e32b9182a84e.png" border="0" alt="" style="border-width: initial; border-color: initial; outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; " /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;变换操作的顺序会影响到最终的效果。如果调换顺序，将得到不同的结果。调换上面代码的顺序将得到如图5-8所示的效果，代码如下：&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;table cellspacing="0" cellpadding="0" width="80%"&gt;&lt;tbody style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;tr style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;td style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; word-break: break-all; word-wrap: break-word; "&gt;&lt;div class="c" style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; word-break: break-all; word-wrap: break-word; clear: both; font: normal normal normal 0px/0px Arial; overflow-x: hidden; overflow-y: hidden; height: 0px; width: 0px; "&gt;&lt;/div&gt;&lt;span class="f10 s8" style="outline-style: none; outline-width: initial; outline-color: initial; font-size: 11px; "&gt;&lt;a href="http://blog.csdn.net/cpskiss/article/details/7056276" style="color: #0070af; text-decoration: none; outline-style: none; outline-width: initial; outline-color: initial; "&gt;复制代码&lt;/a&gt;&lt;/span&gt;&lt;div class="blockquote2" id="code8"&gt;&lt;ol style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 1.5em; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: decimal; list-style-position: initial; "&gt;&lt;li&gt;CGContextRotateCTM (myContext, radians ( 22.));&lt;/li&gt;&lt;li&gt;CGContextScaleCTM (myContext, .25,&amp;nbsp; .5);&lt;/li&gt;&lt;li&gt;CGContextTranslateCTM (myContext, w/4, 0);&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;span id="att_31351" style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;/span&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;img src="http://cc.cocimg.com/bbs/attachment/Fid_6/6_38018_a318dc419b07603.png" border="0" alt="" style="border-width: initial; border-color: initial; outline-style: none; outline-width: initial; outline-color: initial; border-style: initial; border-color: initial; " /&gt;&lt;/span&gt;&amp;nbsp;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;span style="font-size: 18px; outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;创建仿射变换&lt;/span&gt;&lt;/span&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;仿射变换操作在矩阵上，而不是在CTM上。我们可以使用这些函数来构造一个之后用于CTM(调用函数CGContextConcatCTM)的矩阵。仿射变换函数使用或者返回一个CGAffineTransform数据对象。我们可以构建简单或复杂的仿射变换。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;仿射变换函数能实现与CTM函数相同的操作--平移、旋转、缩放、联合。表5-1列出了仿射变换函数及其用途。注意每种变换都有两个函数。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;表5-1 仿射变换函数&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;table class="read_form " cellspacing="0" cellpadding="0"&gt;&lt;tbody style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;tr style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;td style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 0px; padding-left: 5px; word-break: break-all; word-wrap: break-word; height: 20px; border-right-style: solid; border-right-color: #e0e0e0; border-bottom-style: solid; border-bottom-color: #e0e0e0; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;函数&lt;/span&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;/td&gt;&lt;td style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 0px; padding-left: 5px; word-break: break-all; word-wrap: break-word; height: 20px; border-right-style: solid; border-right-color: #e0e0e0; border-bottom-style: solid; border-bottom-color: #e0e0e0; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;用途&lt;/span&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;td style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 0px; padding-left: 5px; word-break: break-all; word-wrap: break-word; height: 20px; border-right-style: solid; border-right-color: #e0e0e0; border-bottom-style: solid; border-bottom-color: #e0e0e0; "&gt;CGAffineTransformMakeTranslation&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;/td&gt;&lt;td style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 0px; padding-left: 5px; word-break: break-all; word-wrap: break-word; height: 20px; border-right-style: solid; border-right-color: #e0e0e0; border-bottom-style: solid; border-bottom-color: #e0e0e0; "&gt;通过指定x, y值来创建一个平移矩阵&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;td style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 0px; padding-left: 5px; word-break: break-all; word-wrap: break-word; height: 20px; border-right-style: solid; border-right-color: #e0e0e0; border-bottom-style: solid; border-bottom-color: #e0e0e0; "&gt;CGAffineTransformTranslate&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;/td&gt;&lt;td style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 0px; padding-left: 5px; word-break: break-all; word-wrap: break-word; height: 20px; border-right-style: solid; border-right-color: #e0e0e0; border-bottom-style: solid; border-bottom-color: #e0e0e0; "&gt;在已存在的矩阵中使用平移&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;td style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 0px; padding-left: 5px; word-break: break-all; word-wrap: break-word; height: 20px; border-right-style: solid; border-right-color: #e0e0e0; border-bottom-style: solid; border-bottom-color: #e0e0e0; "&gt;CGAffineTransformMakeRotation&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;/td&gt;&lt;td style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 0px; padding-left: 5px; word-break: break-all; word-wrap: break-word; height: 20px; border-right-style: solid; border-right-color: #e0e0e0; border-bottom-style: solid; border-bottom-color: #e0e0e0; "&gt;通过指定角度来创建一个旋转矩阵&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;td style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 0px; padding-left: 5px; word-break: break-all; word-wrap: break-word; height: 20px; border-right-style: solid; border-right-color: #e0e0e0; border-bottom-style: solid; border-bottom-color: #e0e0e0; "&gt;CGAffineTransformRotate&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;/td&gt;&lt;td style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 0px; padding-left: 5px; word-break: break-all; word-wrap: break-word; height: 20px; border-right-style: solid; border-right-color: #e0e0e0; border-bottom-style: solid; border-bottom-color: #e0e0e0; "&gt;在已存在的矩阵中使用旋转&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;td style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 0px; padding-left: 5px; word-break: break-all; word-wrap: break-word; height: 20px; border-right-style: solid; border-right-color: #e0e0e0; border-bottom-style: solid; border-bottom-color: #e0e0e0; "&gt;CGAffineTransformMakeScale&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;/td&gt;&lt;td style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 0px; padding-left: 5px; word-break: break-all; word-wrap: break-word; height: 20px; border-right-style: solid; border-right-color: #e0e0e0; border-bottom-style: solid; border-bottom-color: #e0e0e0; "&gt;通过指定x, y缩放因子来创建一个缩放矩阵&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;td style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 0px; padding-left: 5px; word-break: break-all; word-wrap: break-word; height: 20px; border-right-style: solid; border-right-color: #e0e0e0; border-bottom-style: solid; border-bottom-color: #e0e0e0; "&gt;CGAffineTransformScale&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;/td&gt;&lt;td style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 0px; padding-left: 5px; word-break: break-all; word-wrap: break-word; height: 20px; border-right-style: solid; border-right-color: #e0e0e0; border-bottom-style: solid; border-bottom-color: #e0e0e0; "&gt;在已存在的矩阵中使用缩放&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;span style="color: red; outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;Quartz&lt;/span&gt;&lt;/span&gt;同样提供了一个仿射变换函数(CGAffineTransformInvert)来倒置矩阵。倒置操作通常用于在变换对象中提供点的倒置变换。当我们需要恢复一个被矩阵变换的值时，可以使用倒置操作。将值与倒置矩阵相乘，就可得到原先的值。我们通常不需要倒置操作，因为我们可以通过保存和恢复图形状态来倒置CTM的效果。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;在一些情况下，我们可能不需要变换整修空间，而只是一个点或一个大小。我们通过调用CGPointApplyAffineTransform在CGPoint结构上执行变换操作。调用CGSizeApplyAffineTransform在CGSize结构上执行变换操作。调用CGRectApplyAffineTransform在CGRect结构上执行变换操作。CGRectApplyAffineTransform返回一个最小的矩形，该矩形包含了被传递给CGRectApplyAffineTransform的矩形对象的角点。如果矩形上的仿射变换操作只有缩放和平移操作，则返回的矩形与四个变换后的角组成的矩形是一致的。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;可以通过调用函数CGAffineTransformMake来创建一个新的仿射变换，但与其它函数不同的是，它需要提供一个矩阵实体。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;span style="font-size: 18px; outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;评价仿射变换&lt;/span&gt;&lt;/span&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;我们可以通过调用CGAffineTransformEqualToTransform函数来决定一个仿射变换是否与另一个相同。如果两个变换相同，则返回true；否则返回false。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;函数CGAffineTransformIsIdentity用于确认一个变换是否是单位变换。单位变换没有平移、缩放和旋转操作。&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;span style="color: red; outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;Quartz&lt;/span&gt;&lt;/span&gt;常量CGAffineTransformIdentity表示一个单位变换。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;span style="font-size: 16px; outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;获取用户空间到设备空间的变换&lt;/span&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;当使用&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;span style="color: red; outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;Quartz&lt;/span&gt;&lt;/span&gt;&amp;nbsp;2D时，我们只是在用户空间下工作。&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;span style="color: red; outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;Quartz&lt;/span&gt;&lt;/span&gt;为我们处理用户空间和设备空间的转换。如果我们的应用程序需要获取&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;span style="color: red; outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;Quartz&lt;/span&gt;&lt;/span&gt;转换用户空间和设备空间的仿射变换，我们可以调用函数CGContextGetUserSpaceToDeviceSpaceTransform。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;span style="color: red; outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;Quartz&lt;/span&gt;&lt;/span&gt;提供了一系列的函数来转换用户空间和设备空间的几何体。我们会发现这些函数使用赶来比使用CGContextGetUserSpaceToDeviceSpaceTransform函数返回的仿射变换更好用。&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;ul style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 15px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: disc; list-style-position: initial; "&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;点：函数CGContextConvertPointToDeviceSpace和CGContextConvertPointToUserSpace将一个CGPoint数据结构从一个空间变换到另一个空间。&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;大小：函数CGContextConvertSizeToDeviceSpace和CGContextConvertSizeToUserSpace将一个CGSize数据结构从一个空间变换到另一个空间。&lt;/li&gt;&lt;li style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;矩形：函数CGContextConvertRectToDeviceSpace和CGContextConvertRectToUserSpace将一个CGPoint数据结构从一个空间变换到另一个空间。&lt;/li&gt;&lt;/ul&gt;&lt;/span&gt;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/85538649/aggbug/2505434.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/85538649/archive/2012/05/16/2505434.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/85538649/archive/2012/05/16/2505387.html</id><title type="text">iPhone  IOS区域截图</title><summary type="text">转载：http://talentwsc.blog.163.com/blog/static/68743076201231322844508/在ios开发中，肯定会碰到需要截取部分图片的情况。最终的效果类似这样：先看最原始的示例，显示完整的图片写了个最简单的读取图片并显示的代码，打算以此为开始，逐渐实现截取部分图片的功能。代码主要是，在控制器代码中：- (void)loadView {[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation: UIStatusBarAnimationSlide];UIImage </summary><published>2012-05-16T12:48:00Z</published><updated>2012-05-16T12:48:00Z</updated><author><name>wtq</name><uri>http://www.cnblogs.com/85538649/</uri></author><link rel="alternate" href="http://www.cnblogs.com/85538649/archive/2012/05/16/2505387.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/85538649/archive/2012/05/16/2505387.html"/><content type="html">&lt;p&gt;转载：&lt;a href="http://talentwsc.blog.163.com/blog/static/68743076201231322844508/"&gt;http://talentwsc.blog.163.com/blog/static/68743076201231322844508/&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="color: #464646; font-family: simsun; font-size: 14px; line-height: 25px; background-color: #bcd3e5; "&gt;&lt;p&gt;&lt;span style="line-height: 20px; word-wrap: normal; word-break: normal; color: #333333; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; "&gt;在ios开发中，肯定会碰到需要截取部分图片的情况。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;最终的效果类似这样：&lt;/p&gt;&lt;p&gt;&lt;a rel="nofollow" href="http://marshal.easymorse.com/wp-content/uploads/2010/11/image35.png" style="color: #3e73a0; line-height: 25px; text-decoration: none; "&gt;&lt;img border="0" alt="image" src="http://marshal.easymorse.com/wp-content/uploads/2010/11/image_thumb35.png" real_src="http://marshal.easymorse.com/wp-content/uploads/2010/11/image_thumb35.png" width="197" height="244" style="line-height: 25px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; max-width: 100%; margin-top: 0px; margin-right: 8px; margin-bottom: 0px; margin-left: 4px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; background-image: none; display: inline; " /&gt;&lt;/a&gt;&lt;a rel="nofollow" href="http://marshal.easymorse.com/wp-content/uploads/2010/11/image36.png" style="color: #3e73a0; line-height: 25px; text-decoration: none; "&gt;&lt;img border="0" alt="image" src="http://marshal.easymorse.com/wp-content/uploads/2010/11/image_thumb36.png" real_src="http://marshal.easymorse.com/wp-content/uploads/2010/11/image_thumb36.png" width="193" height="244" style="line-height: 25px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; max-width: 100%; margin-top: 0px; margin-right: 8px; margin-bottom: 0px; margin-left: 4px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; background-image: none; display: inline; " /&gt;&lt;/a&gt;&lt;/p&gt;&lt;h3 style="line-height: 36px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; font-family: Georgia; font-size: 20px; "&gt;先看最原始的示例，显示完整的图片&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;写了个最简单的读取图片并显示的代码，打算以此为开始，逐渐实现截取部分图片的功能。&lt;/p&gt;&lt;p&gt;代码主要是，在控制器代码中：&lt;/p&gt;&lt;blockquote style="line-height: 25px; font-size: 1em; margin-top: 3px; margin-right: 30px; margin-bottom: 3px; margin-left: 30px; background-image: initial; background-color: #f4f4f4; padding-right: 15px; padding-left: 15px; "&gt;&lt;p&gt;- (void)loadView {&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation: UIStatusBarAnimationSlid&lt;wbr style="line-height: 25px; "&gt;e];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;UIImage *image=[UIImage imageNamed:@"1.jpg"];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;UIImageView *contentView = [[UIImageView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;[contentView setImage:image];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;self.view=[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;[self.view addSubview:contentView];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;}&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;另外，应该有一个名为1.jpg的768&amp;#215;1024的图片（我这里是iPad）。&lt;/p&gt;&lt;p&gt;&lt;span style="line-height: 21px; word-wrap: normal; word-break: normal; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;/p&gt;&lt;h3 style="line-height: 36px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; font-family: Georgia; font-size: 20px; "&gt;截取整个图片&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;可以认为截取整个图片是截取部分图片的一个特例。对ios不熟嘛，因此打算很谨慎的推进。截取整个图片可以减少中间的复杂性。&lt;/p&gt;&lt;p&gt;根据API，摸索着写了一个示例，效果出乎意料：&lt;/p&gt;&lt;p&gt;&lt;a rel="nofollow" href="http://marshal.easymorse.com/wp-content/uploads/2010/11/image37.png" style="color: #3e73a0; line-height: 25px; text-decoration: none; "&gt;&lt;img border="0" alt="image" src="http://marshal.easymorse.com/wp-content/uploads/2010/11/image_thumb37.png" real_src="http://marshal.easymorse.com/wp-content/uploads/2010/11/image_thumb37.png" width="190" height="244" style="line-height: 25px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; max-width: 100%; margin-top: 0px; margin-right: 8px; margin-bottom: 0px; margin-left: 4px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; background-image: none; display: inline; " /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;代码：&lt;/p&gt;&lt;blockquote style="line-height: 25px; font-size: 1em; margin-top: 3px; margin-right: 30px; margin-bottom: 3px; margin-left: 30px; background-image: initial; background-color: #f4f4f4; padding-right: 15px; padding-left: 15px; "&gt;&lt;p&gt;- (void)loadView {&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation: UIStatusBarAnimationSlid&lt;wbr style="line-height: 25px; "&gt;e];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;UIImage *image=[UIImage imageNamed:@"1.jpg"];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;UIImageView *contentView = [[UIImageView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;//[contentView setImage:image];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;CGRect rect = CGRectMake(0, 0, 768, 1024);//创建矩形框&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;UIGraphicsBeginImageCont&lt;wbr style="line-height: 25px; "&gt;ext(rect.size);//根据size大小创建一个基于位图的图形上下文&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;CGContextRef currentContext = UIGraphicsGetCurrentCont&lt;wbr style="line-height: 25px; "&gt;ext();//获取当前quartz 2d绘图环境&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;CGContextClipToRect( currentContext, rect);//设置当前绘图环境到矩形框&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;CGContextDrawImage(currentContext, rect, image.CGImage);//绘图&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;UIImage *cropped = UIGraphicsGetImageFromCu&lt;wbr style="line-height: 25px; "&gt;rrentImageContext();//获得图片&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;UIGraphicsEndImageContex&lt;wbr style="line-height: 25px; "&gt;t();//从当前堆栈中删除quartz 2d绘图环境&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;contentView.image=cropped;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;self.view=[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;[self.view addSubview:contentView];&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;[cropped release];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;}&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;这个代码说明了两点：&lt;/p&gt;&lt;ul style="line-height: 25px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;&lt;li style="line-height: 25px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: disc; list-style-position: initial; list-style-image: initial; "&gt;好的方面：说明我的代码起作用了，确实截取了所需的图形&lt;/li&gt;&lt;li style="line-height: 25px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: disc; list-style-position: initial; list-style-image: initial; "&gt;坏的方面：图形是颠倒的，而且是镜像的。&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;问题应该出在坐标系上。下面画了一个quartz 2d的坐标系，坐标原点在左下角：&lt;/p&gt;&lt;p&gt;&lt;a rel="nofollow" href="http://marshal.easymorse.com/wp-content/uploads/2010/11/image38.png" style="color: #3e73a0; line-height: 25px; text-decoration: none; "&gt;&lt;img border="0" alt="image" src="http://marshal.easymorse.com/wp-content/uploads/2010/11/image_thumb38.png" real_src="http://marshal.easymorse.com/wp-content/uploads/2010/11/image_thumb38.png" width="203" height="244" style="line-height: 25px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; max-width: 100%; margin-top: 0px; margin-right: 8px; margin-bottom: 0px; margin-left: 4px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; background-image: none; display: inline; " /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;因此以这个坐标系取图形，就会有转向180&amp;#176;的效果。&lt;/p&gt;&lt;p&gt;其实如果是对图片的缩放，而不是剪切部分图片内容，这样写就可以了：&lt;/p&gt;&lt;blockquote style="line-height: 25px; font-size: 1em; margin-top: 3px; margin-right: 30px; margin-bottom: 3px; margin-left: 30px; background-image: initial; background-color: #f4f4f4; padding-right: 15px; padding-left: 15px; "&gt;&lt;p&gt;- (void)loadView {&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation: UIStatusBarAnimationSlid&lt;wbr style="line-height: 25px; "&gt;e];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;UIImage *image=[UIImage imageNamed:@"1.jpg"];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;//[contentView setImage:image];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;CGRect rect = CGRectMake(0, 0, 384, 512);//创建矩形框&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;UIGraphicsBeginImageCont&lt;wbr style="line-height: 25px; "&gt;ext(rect.size);//根据size大小创建一个基于位图的图形上下文&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;CGContextRef currentContext = UIGraphicsGetCurrentCont&lt;wbr style="line-height: 25px; "&gt;ext();//获取当前quartz 2d绘图环境&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;CGContextClipToRect(currentContext, rect);//设置当前绘图环境到矩形框&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;//CGContextRotateCTM(currentContext, 50);&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;//CGContextDrawImage(currentContext, rect, image.CGImage);//绘图&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;[image drawInRect:rect];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;UIImage *cropped = UIGraphicsGetImageFromCu&lt;wbr style="line-height: 25px; "&gt;rrentImageContext();//获得图片&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;UIGraphicsEndImageContex&lt;wbr style="line-height: 25px; "&gt;t();//从当前堆栈中删除quartz 2d绘图环境&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;UIImageView *contentView = [[UIImageView alloc] initWithFrame:rect];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;contentView.image=cropped;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;self.view=[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;[self.view addSubview:contentView];&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;[cropped release];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;}&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;效果类似这样：&lt;/p&gt;&lt;p&gt;&lt;a rel="nofollow" href="http://marshal.easymorse.com/wp-content/uploads/2010/11/image39.png" style="color: #3e73a0; line-height: 25px; text-decoration: none; "&gt;&lt;img border="0" alt="image" src="http://marshal.easymorse.com/wp-content/uploads/2010/11/image_thumb39.png" real_src="http://marshal.easymorse.com/wp-content/uploads/2010/11/image_thumb39.png" width="193" height="244" style="line-height: 25px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; max-width: 100%; margin-top: 0px; margin-right: 8px; margin-bottom: 0px; margin-left: 4px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; background-image: none; display: inline; " /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;这个方法可以帮助我们在后续开发中实现缩略图。但是不符合现在的需求。&lt;/p&gt;&lt;p&gt;于是想了下面的基本思路：&lt;/p&gt;&lt;p&gt;&lt;a rel="nofollow" href="http://marshal.easymorse.com/wp-content/uploads/2010/11/image40.png" style="color: #3e73a0; line-height: 25px; text-decoration: none; "&gt;&lt;img border="0" alt="image" src="http://marshal.easymorse.com/wp-content/uploads/2010/11/image_thumb40.png" real_src="http://marshal.easymorse.com/wp-content/uploads/2010/11/image_thumb40.png" width="237" height="244" style="line-height: 25px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; max-width: 100%; margin-top: 0px; margin-right: 8px; margin-bottom: 0px; margin-left: 4px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; background-image: none; display: inline; " /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;这样，需要一个能旋转和向下移动的API。ios提供了C++界面的函数调用：&lt;/p&gt;&lt;ul style="line-height: 25px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;&lt;li style="line-height: 25px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: disc; list-style-position: initial; list-style-image: initial; "&gt;CGContextRotateCTM，实现角度的转换&lt;/li&gt;&lt;li style="line-height: 25px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 30px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: disc; list-style-position: initial; list-style-image: initial; "&gt;CGContextTranslateCTM，可以重新设置坐标系原点，平移坐标系和移动图片是等效的&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;代码：&lt;/p&gt;&lt;blockquote style="line-height: 25px; font-size: 1em; margin-top: 3px; margin-right: 30px; margin-bottom: 3px; margin-left: 30px; background-image: initial; background-color: #f4f4f4; padding-right: 15px; padding-left: 15px; "&gt;&lt;p&gt;- (void)loadView {&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation: UIStatusBarAnimationSlid&lt;wbr style="line-height: 25px; "&gt;e];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;UIImage *image=[UIImage imageNamed:@"1.jpg"];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;//[contentView setImage:image];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;CGRect rect = CGRectMake(0, 0, 384, 512);//创建矩形框&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;UIGraphicsBeginImageCont&lt;wbr style="line-height: 25px; "&gt;ext(rect.size);//根据size大小创建一个基于位图的图形上下文&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;CGContextRef currentContext = UIGraphicsGetCurrentCont&lt;wbr style="line-height: 25px; "&gt;ext();//获取当前quartz 2d绘图环境&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;CGContextClipToRect(currentContext, rect);//设置当前绘图环境到矩形框&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;CGContextRotateCTM(currentContext, M_PI);&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;CGContextTranslateCTM(currentContext, -rect.size.width, -rect.size.height);&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;CGContextDrawImage(currentContext, rect, image.CGImage);//绘图&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;//[image drawInRect:rect];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;UIImage *cropped = UIGraphicsGetImageFromCu&lt;wbr style="line-height: 25px; "&gt;rrentImageContext();//获得图片&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;UIGraphicsEndImageContex&lt;wbr style="line-height: 25px; "&gt;t();//从当前堆栈中删除quartz 2d绘图环境&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;UIImageView *contentView = [[UIImageView alloc] initWithFrame:rect];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;contentView.image=cropped;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;self.view=[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;[self.view addSubview:contentView];&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;[cropped release];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;}&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;a rel="nofollow" href="http://marshal.easymorse.com/wp-content/uploads/2010/11/image41.png" style="color: #3e73a0; line-height: 25px; text-decoration: none; "&gt;&lt;img border="0" alt="image" src="http://marshal.easymorse.com/wp-content/uploads/2010/11/image_thumb41.png" real_src="http://marshal.easymorse.com/wp-content/uploads/2010/11/image_thumb41.png" width="192" height="244" style="line-height: 25px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; max-width: 100%; margin-top: 0px; margin-right: 8px; margin-bottom: 0px; margin-left: 4px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; background-image: none; display: inline; " /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;这个结果还有缺陷，可以看到图片是正立的了，但是图片反转了，是个镜像。&lt;/p&gt;&lt;p&gt;解决办法也有，不过不是操作图片了，而是操作图片所在的视图。思路是把视图看作一个位图的矩阵，对它做矩阵变换运算，使视图做镜像反转。写法很简单：&lt;/p&gt;&lt;blockquote style="line-height: 25px; font-size: 1em; margin-top: 3px; margin-right: 30px; margin-bottom: 3px; margin-left: 30px; background-image: initial; background-color: #f4f4f4; padding-right: 15px; padding-left: 15px; "&gt;&lt;p&gt;- (void)loadView {&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation: UIStatusBarAnimationSlid&lt;wbr style="line-height: 25px; "&gt;e];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;UIImage *image=[UIImage imageNamed:@"1.jpg"];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;//[contentView setImage:image];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;CGRect rect = CGRectMake(0, 0, 384, 512);//创建矩形框&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;UIGraphicsBeginImageCont&lt;wbr style="line-height: 25px; "&gt;ext(rect.size);//根据size大小创建一个基于位图的图形上下文&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;CGContextRef currentContext = UIGraphicsGetCurrentCont&lt;wbr style="line-height: 25px; "&gt;ext();//获取当前quartz 2d绘图环境&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;CGContextClipToRect(currentContext, rect);//设置当前绘图环境到矩形框&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;CGContextRotateCTM(currentContext, M_PI);&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;CGContextTranslateCTM(currentContext, -rect.size.width, -rect.size.height);&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;//CGContextTranslateCTM(currentContext,0.0,200.0);&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;CGContextDrawImage(currentContext, rect, image.CGImage);//绘图&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;//[image drawInRect:rect];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;UIImage *cropped = UIGraphicsGetImageFromCu&lt;wbr style="line-height: 25px; "&gt;rrentImageContext();//获得图片&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;UIGraphicsEndImageContex&lt;wbr style="line-height: 25px; "&gt;t();//从当前堆栈中删除quartz 2d绘图环境&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;UIImageView *contentView = [[UIImageView alloc] initWithFrame:rect];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;contentView.image=cropped;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;contentView.transform = CGAffineTransformIdentit&lt;wbr style="line-height: 25px; "&gt;y;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;contentView.transform = CGAffineTransformMakeSca&lt;wbr style="line-height: 25px; "&gt;le(-1.0, 1.0);&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;self.view=[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;[self.view addSubview:contentView];&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;[cropped release];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;}&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;这里的转换因子，一个是针对x轴的，一个是针对y轴的。终于可以产生这样的效果了：&lt;/p&gt;&lt;p&gt;&lt;a rel="nofollow" href="http://marshal.easymorse.com/wp-content/uploads/2010/11/image42.png" style="color: #3e73a0; line-height: 25px; text-decoration: none; "&gt;&lt;img border="0" alt="image" src="http://marshal.easymorse.com/wp-content/uploads/2010/11/image_thumb42.png" real_src="http://marshal.easymorse.com/wp-content/uploads/2010/11/image_thumb42.png" width="189" height="244" style="line-height: 25px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; max-width: 100%; margin-top: 0px; margin-right: 8px; margin-bottom: 0px; margin-left: 4px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; background-image: none; display: inline; " /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;这里参考了这个文档：&lt;/p&gt;&lt;blockquote style="line-height: 25px; font-size: 1em; margin-top: 3px; margin-right: 30px; margin-bottom: 3px; margin-left: 30px; background-image: initial; background-color: #f4f4f4; padding-right: 15px; padding-left: 15px; "&gt;&lt;p&gt;&lt;a title="http://macdevcenter.com/pub/a/mac/2004/11/02/quartz.html" rel="nofollow" href="http://macdevcenter.com/pub/a/mac/2004/11/02/quartz.html" style="color: #3e73a0; line-height: 25px; text-decoration: none; "&gt;http://macdevcenter.com/pub/a/mac/2004/11/02/quartz.html&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;虽然是很古老的文章了，但是说的很清楚。另外，方法名称已经发生变化，需要注意。&lt;/p&gt;&lt;h3 style="line-height: 36px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; font-family: Georgia; font-size: 20px; "&gt;截取部分图片&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;截取部分图片，比如：&lt;/p&gt;&lt;p&gt;&lt;a rel="nofollow" href="http://marshal.easymorse.com/wp-content/uploads/2010/11/image43.png" style="color: #3e73a0; line-height: 25px; text-decoration: none; "&gt;&lt;img border="0" alt="image" src="http://marshal.easymorse.com/wp-content/uploads/2010/11/image_thumb43.png" real_src="http://marshal.easymorse.com/wp-content/uploads/2010/11/image_thumb43.png" width="184" height="244" style="line-height: 25px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; max-width: 100%; margin-top: 0px; margin-right: 8px; margin-bottom: 0px; margin-left: 4px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; background-image: none; display: inline; " /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;截取左边人像部分。&lt;/p&gt;&lt;p&gt;实现后的代码，效果是这样的：&lt;/p&gt;&lt;p&gt;&lt;a rel="nofollow" href="http://marshal.easymorse.com/wp-content/uploads/2010/11/image44.png" style="color: #3e73a0; line-height: 25px; text-decoration: none; "&gt;&lt;img border="0" alt="image" src="http://marshal.easymorse.com/wp-content/uploads/2010/11/image_thumb44.png" real_src="http://marshal.easymorse.com/wp-content/uploads/2010/11/image_thumb44.png" width="192" height="244" style="line-height: 25px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; max-width: 100%; margin-top: 0px; margin-right: 8px; margin-bottom: 0px; margin-left: 4px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; list-style-type: none; list-style-position: initial; list-style-image: initial; background-image: none; display: inline; " /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;如何实现的呢，这时候才发现，其实根本不需要上面那些转换，如果不使用quartz 2d的话，截取部分图片这么简单：&lt;/p&gt;&lt;blockquote style="line-height: 25px; font-size: 1em; margin-top: 3px; margin-right: 30px; margin-bottom: 3px; margin-left: 30px; background-image: initial; background-color: #f4f4f4; padding-right: 15px; padding-left: 15px; "&gt;&lt;p&gt;- (void)loadView {&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation: UIStatusBarAnimationSlid&lt;wbr style="line-height: 25px; "&gt;e];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;UIImage *image=[UIImage imageNamed:@"1.jpg"];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;CGRect rect = CGRectMake(60, 80, 331, 353);//创建矩形框&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;UIImageView *contentView = [[UIImageView alloc] initWithFrame:rect];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;contentView.image=[UIImage imageWithCGImage:CGImageCreateWithImageIn&lt;wbr style="line-height: 25px; "&gt;Rect([image CGImage], rect)];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;self.view=[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;[self.view addSubview:contentView];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&amp;nbsp;[image release];&amp;nbsp;&lt;wbr style="line-height: 25px; "&gt;&lt;br style="line-height: 25px; " /&gt;}&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;虽然编写代码的过程是曲折的，但是摸到很多有用的东西，都是以后要用到的。&lt;/p&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/85538649/aggbug/2505387.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/85538649/archive/2012/05/16/2505387.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/85538649/archive/2012/05/16/2503952.html</id><title type="text">iphone UIView的一些基本方法理解</title><summary type="text">原文链接地址：http://www.cocoachina.com/bbs/read.php?tid=38766UIView的一些基本方法理解UIView的一些基本方法理解：loadView、viewDidLoad、viewDidUnload、viewWillAppear、viewWillDisappear经常使用UIView以及它的子类，一般对于init:，viewDidLoad：,dealloc：等方法应该是比较熟悉和了解的。对于其它几个基本方法就不那么常用了，为了更好地编程使用这些方法，在此集中收集整理一下各方法调用的时机和作用：init:方法在init方法中实例化必要的对象（遵从Lazy</summary><published>2012-05-16T06:31:00Z</published><updated>2012-05-16T06:31:00Z</updated><author><name>wtq</name><uri>http://www.cnblogs.com/85538649/</uri></author><link rel="alternate" href="http://www.cnblogs.com/85538649/archive/2012/05/16/2503952.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/85538649/archive/2012/05/16/2503952.html"/><content type="html">&lt;p&gt;原文链接地址：&lt;a href="http://www.cocoachina.com/bbs/read.php?tid=38766"&gt;http://www.cocoachina.com/bbs/read.php?tid=38766&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="color: #333333; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, sans-serif; font-size: 12px; line-height: 15px; background-color: #ffffff; "&gt;&lt;div class="read_h1" id="subject_239383" style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 15px; margin-right: 15px; margin-bottom: 15px; margin-left: 15px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; word-break: break-all; word-wrap: break-word; font-size: 16px; color: #3366cc; font-weight: 700; line-height: 1; "&gt;UIView的一些基本方法理解&lt;/div&gt;&lt;div class="c" style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; word-break: break-all; word-wrap: break-word; clear: both; font: normal normal normal 0px/0px Arial; overflow-x: hidden; overflow-y: hidden; height: 0px; width: 0px; "&gt;&lt;/div&gt;&lt;div class="tpc_content" style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 15px; padding-bottom: 20px; padding-left: 15px; word-break: break-all; word-wrap: break-word; line-height: 2em; "&gt;&lt;div id="p_239383" class="c" style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; word-break: break-all; word-wrap: break-word; clear: both; font: normal normal normal 0px/0px Arial; overflow-x: hidden; overflow-y: hidden; height: 0px; width: 0px; "&gt;&lt;/div&gt;&lt;div class="f14" id="read_239383" style="outline-style: none; outline-width: initial; outline-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; word-break: break-all; word-wrap: break-word; font-size: 14px; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #ff0000; "&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;UIView的一些基本方法理解：loadView、viewDidLoad、viewDidUnload、viewWillAppear、viewWillDisappear&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;/font&gt;&lt;/span&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;经常使用UIView以及它的子类，一般对于init:，viewDidLoad：,dealloc：等方法应该是比较熟悉和了解的。&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;对于其它几个基本方法就不那么常用了，为了更好地编程使用这些方法，在此集中收集整理一下各方法调用的时机和作用：&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="verdana,geneva,arial,helvetica,sans-serif " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;init:方法&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;在init方法中实例化必要的对象（遵从LazyLoad思想）&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;init方法中初始化ViewController本身&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="verdana,geneva,arial,helvetica,sans-serif " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;loadView:方法&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="verdana,geneva,arial,helvetica,sans-serif " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #000000; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #ff0000; "&gt;这是当没有正在使用nib视图页面，子类将会创建自己的自定义视图层。绝不能直接调用&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;。&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="verdana,geneva,arial,helvetica,sans-serif " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #ff0000; "&gt;如果手工维护views，必须重载重写该方法。&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;当view需要被展示而它却是nil时，viewController会调用该方法。&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;loadView和IB构建view&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;你在控制器中实现了loadView方法，那么你可能会在应用运行的某个时候被内存管理控制调用。 如果设备内存不足的时候， view 控制器会收到didReceiveMemoryWarning的消息。 默认的实现是检查当前控制器的view是否在使用。 如果它的view不在当前正在使用的view hierarchy里面，且你的控制器实现了loadView方法，那么这个view将被release, loadView方法将被再次调用来创建一个新的view。&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;viewDidLoad:方法&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #ff0000; "&gt;在视图加载后被调用：&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #ff0000; "&gt;如果是在代码中创建的视图加载器，他将会在loadView方法后被调用；&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #ff0000; "&gt;如果是从nib视图页面输出，他将会在视图设置好后后被调用。&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;重载重写该方法以进一步定制view&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;在iPhone OS 3.0及之后的版本中，还应该重载重写viewDidUnload来释放对view的任何索引&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;viewDidLoad后调用数据Model&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;viewDidUnload:方法&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;当系统内存吃紧的时候会调用该方法（注：viewController没有被dealloc）&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;内存吃紧时，在iPhone OS 3.0之前didReceiveMemoryWarning是释放无用内存的唯一方式，但是OS 3.0及以后viewDidUnload方法是更好的方式&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;在该方法中将所有IBOutlet（无论是property还是实例变量）置为nil（系统release view时已经将其release掉了）&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;在该方法中释放其他与view有关的对象、其他在运行时创建（但非系统必须）的对象、在viewDidLoad中被创建的对象、缓存数据等 release对象后，将对象置为nil（IBOutlet只需要将其置为nil，系统release view时已经将其release掉了）&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;一般认为viewDidUnload是viewDidLoad的镜像，因为当view被重新请求时，viewDidLoad还会重新被执行&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;viewDidUnload中被release的对象必须是很容易被重新创建的对象（比如在viewDidLoad或其他方法中创建的对象），不要release用户数据或其他很难被重新创建的对象&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;dealloc:方法&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;viewDidUnload和dealloc方法没有关联，dealloc还是继续做它该做的事情&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="verdana,sans-serif " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #000000; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #000000; "&gt;viewWillAppear:&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="verdana,geneva,arial,helvetica,sans-serif " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="verdana,geneva,arial,helvetica,sans-serif " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;&lt;strong style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #4b4b4b; "&gt;方法&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #000000; "&gt;Called when the view is about to made visible. Default does nothing&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #000000; "&gt;视图即将可见时调用。默认情况下不执行任何操作&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="verdana,sans-serif " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #000000; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #000000; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;/font&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #000000; "&gt;viewDidAppear:&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #000000; "&gt;Called when the view has been fully transitioned onto the screen. Default does nothing&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #000000; "&gt;视图已完全过渡到屏幕上时调用&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="verdana,sans-serif " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #000000; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #000000; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;/font&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #000000; "&gt;viewWillDisappear:&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #000000; "&gt;Called when the view is dismissed, covered or otherwise hidden. Default does nothing&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #000000; "&gt;视图被驳回时调用，覆盖或以其他方式隐藏。默认情况下不执行任何操作&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="4" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="verdana,sans-serif " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #000000; "&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #000000; "&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;/font&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #000000; "&gt;viewDidDisappear:&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #000000; "&gt;Called after the view was dismissed, covered or otherwise hidden. Default does nothing&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;br style="outline-style: none; outline-width: initial; outline-color: initial; " /&gt;&lt;font size="2" style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;font face="arial,宋体 " style="outline-style: none; outline-width: initial; outline-color: initial; line-height: 1.5em; "&gt;&lt;span style="outline-style: none; outline-width: initial; outline-color: initial; color: #000000; "&gt;视图被驳回后调用，覆盖或以其他方式隐藏。默认情况下不执行任何操作&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/85538649/aggbug/2503952.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/85538649/archive/2012/05/16/2503952.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/85538649/archive/2012/05/16/2503649.html</id><title type="text">ipad  UISplitViewController 导航视图控制器标题设置</title><summary type="text">描述：在使用UISplitViewController时 ，如何修改导航视图控制器的标题呢？如图 修改方法：在导航视图控制器 初始化时，设置导航视图控制器本身的title，比如：self.title = @" ";</summary><published>2012-05-16T03:28:00Z</published><updated>2012-05-16T03:28:00Z</updated><author><name>wtq</name><uri>http://www.cnblogs.com/85538649/</uri></author><link rel="alternate" href="http://www.cnblogs.com/85538649/archive/2012/05/16/2503649.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/85538649/archive/2012/05/16/2503649.html"/><content type="html">&lt;p&gt;描述：在使用UISplitViewController时 ，如何修改导航视图控制器的标题呢？如图&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;img src="http://images.cnblogs.com/cnblogs_com/85538649/doorInfo.jpg" width="517" height="226" alt="" /&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; 修改方法：在导航视图控制器 初始化时，设置导航视图控制器本身的title，比如：self.title = @" &amp;nbsp; &amp;nbsp;";&lt;/p&gt;&lt;img src="http://www.cnblogs.com/85538649/aggbug/2503649.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/85538649/archive/2012/05/16/2503649.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/85538649/archive/2012/05/15/2501721.html</id><title type="text">iphone  如何辨别99美元的账户是个人版的还是公司版的账户</title><summary type="text">Member Center步骤:1公司帐号比个人多一些帐号管理的设置：个人帐号集Agent，Admin，Developer等为一身，而公司帐号可以设置不同的AppleID来担当。2. 登录https://developer.apple.com/ 这个账号3.进入“Member CenterMember Center” ,并查看是否可以添加账号。 如果出现以上界面，则说明是99美元的账号是公司版本的。可以支持多个人共同开发测试。</summary><published>2012-05-15T07:52:00Z</published><updated>2012-05-15T07:52:00Z</updated><author><name>wtq</name><uri>http://www.cnblogs.com/85538649/</uri></author><link rel="alternate" href="http://www.cnblogs.com/85538649/archive/2012/05/15/2501721.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/85538649/archive/2012/05/15/2501721.html"/><content type="html">&lt;p&gt;&lt;div style="display: inline-block; "&gt;&lt;/div&gt;&lt;/p&gt;&lt;span style="color: #333333; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 20px; background-color: #f1f1f1; "&gt;&lt;ul id="gh-nav" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: outside; list-style-image: initial; position: absolute; right: 200px; top: 1px; "&gt;&lt;li id="gh-nav-membercenter" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 2.8em; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; display: inline; float: left; "&gt;&lt;a href="https://developer.apple.com/membercenter/" style="color: #0088cc; text-decoration: none; display: block; padding-top: 0.3em; padding-right: 0px; padding-bottom: 0.3em; padding-left: 5px; text-shadow: #ffffff 0px 1px 0px; line-height: 18px; "&gt;Member Center&lt;/a&gt;&lt;div&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div id="gh-search" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; position: absolute; top: 5px; right: 10px; "&gt;&lt;form action="https://developer.apple.com/search/index.php" method="get" accept-charset="utf-8" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;label for="gh-adcsearch"&gt;&lt;/label&gt;&lt;/div&gt;&lt;/form&gt;&lt;/div&gt;&lt;/span&gt;&lt;p&gt;步骤:&amp;nbsp;&lt;/p&gt;&lt;p&gt;1&lt;span class="Apple-style-span" style="color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 16px; background-color: #ffffff; "&gt;&lt;span class="Apple-style-span" style="line-height: 20px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; background-color: #eeeeee; "&gt;公司帐号比个人多一些帐号管理的设置：个人帐号集Agent，Admin，Developer等为一身，而公司帐号可以设置不同的AppleID来担当。&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;2. 登录&lt;a href="https://developer.apple.com/"&gt;https://developer.apple.com/&lt;/a&gt;&amp;nbsp; 这个账号&lt;/p&gt;&lt;p&gt;3.进入&amp;#8220;&lt;div style="display: inline-block; "&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="color: #333333; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Helvetica, Arial, Verdana, sans-serif; font-size: 12px; line-height: 20px; background-color: #f1f1f1; "&gt;&lt;ul id="gh-nav" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: outside; list-style-image: initial; position: absolute; right: 200px; top: 1px; "&gt;&lt;li id="gh-nav-membercenter" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 2.8em; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; display: inline; float: left; "&gt;&lt;a href="https://developer.apple.com/membercenter/" style="color: #0088cc; text-decoration: none; display: block; padding-top: 0.3em; padding-right: 0px; padding-bottom: 0.3em; padding-left: 5px; text-shadow: #ffffff 0px 1px 0px; line-height: 18px; "&gt;Member Center&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div id="gh-search" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; position: absolute; top: 5px; right: 10px; "&gt;&lt;form action="https://developer.apple.com/search/index.php" method="get" accept-charset="utf-8" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;label for="gh-adcsearch"&gt;&lt;span class="prettyplaceholder" style="display: block; overflow-x: hidden; overflow-y: hidden; text-indent: -9999px; height: 0px; width: 0px; "&gt;&lt;/span&gt;&lt;/label&gt;&lt;/div&gt;&lt;/form&gt;&lt;/div&gt;&lt;/span&gt;Member Center&amp;#8221; ,并查看是否可以添加账号。&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;img src="http://images.cnblogs.com/cnblogs_com/85538649/1212.jpg" width="1137" height="268" alt="" /&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;img src="file:///C:/Documents%20and%20Settings/wtq/Application%20Data/Tencent/Users/562925960/QQ/WinTemp/RichOle/9BIJM%]U_WVWZTMTL4O8ON8.jpg"  alt="" /&gt;&lt;img src="file:///C:/Documents%20and%20Settings/wtq/Application%20Data/Tencent/Users/562925960/QQ/WinTemp/RichOle/9BIJM%]U_WVWZTMTL4O8ON8.jpg"  alt="" /&gt;如果出现以上界面，则说明是99美元的账号是公司版本的。可以支持多个人共同开发测试。&lt;/p&gt;&lt;div&gt;&lt;div&gt; &lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;img src="http://www.cnblogs.com/85538649/aggbug/2501721.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/85538649/archive/2012/05/15/2501721.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry></feed>
