<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">博客园_洛客</title><subtitle type="text">追求完美的用户体验。 </subtitle><id>http://feed.cnblogs.com/blog/u/25580/rss</id><updated>2012-01-11T01:40:21Z</updated><author><name>洛客</name><uri>http://www.cnblogs.com/Luoke365/</uri></author><generator>CNBlogs BlogServer</generator><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Luoke365/"/><link rel="self" type="application/atom+xml" href="http://feed.cnblogs.com/blog/u/25580/rss"/><entry><id>http://www.cnblogs.com/Luoke365/archive/2012/01/11/2318793.html</id><title type="text">IOS SDK 兼容性 研究</title><summary type="text">如何设置 Base SDK 和 iOS Deployment Target ？在iPhone 开发中，时常被版本所困扰， 苹果公司总会定期发布 iPhone 开发包，不是仅仅发布一个 patch， 而是整个 开发包完全更新，况且，还不支持断电续传，iOS 4.3 以后的版本， 已达 4 G 之多， 下载工作量 可想而知。正是因为更新频繁， 我们需要搞清楚 XCcode 版本 和 iOS SDK 版本。 如何查看这两个版本号呢？在开发iphone 之前，首先需要从 苹果 iphone 开发网站上，下载所需的 SDK。 这个开发包 本身就带有 版本信息。 比如：下载 苹果最新发布的： xcode.</summary><published>2012-01-11T01:40:00Z</published><updated>2012-01-11T01:40:00Z</updated><author><name>洛客</name><uri>http://www.cnblogs.com/Luoke365/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Luoke365/archive/2012/01/11/2318793.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Luoke365/archive/2012/01/11/2318793.html"/><content type="html">&lt;div style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: 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; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; word-break: normal; word-wrap: break-word; font-family: 'Lucida Sans Unicode', 'Lucida Grande', Helvetica, Arial, sans-serif; line-height: 18px; text-align: left; -webkit-text-size-adjust: none; "&gt;&lt;p&gt;&lt;strong&gt;如何设置 Base SDK 和 iOS Deployment Target ？&lt;/strong&gt;&lt;/p&gt;&lt;/div&gt;&lt;div style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; margin-top: 5px; margin-right: 4px; margin-bottom: 5px; margin-left: 4px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; word-break: normal; word-wrap: break-word; text-shadow: #e5e5e5 0px 1px 0px; text-align: left; "&gt;&lt;p style="color: #444444; font-family: 'Lucida Sans Unicode', 'Lucida Grande', Helvetica, Arial, sans-serif; font-size: 11px; line-height: 1.8; -webkit-text-size-adjust: none; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; margin-top: 8px; margin-right: 0px; margin-bottom: 8px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; word-break: normal; word-wrap: break-word; "&gt;&lt;span style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: 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; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; font-size: x-small; "&gt;在iPhone 开发中，时常被版本所困扰， 苹果公司总会定期发布 iPhone 开发包，不是仅仅发布一个 patch， 而是整个 开发包完全更新，况且，还不支持断电续传，iOS 4.3 以后的版本， 已达 4 G 之多， 下载工作量 可想而知。&amp;nbsp;正是因为更新频繁， 我们需要搞清楚 &amp;nbsp;XCcode 版本 和 &amp;nbsp;iOS SDK 版本。 如何查看这两个版本号呢？&lt;/span&gt;&lt;/p&gt;&lt;p style="color: #444444; font-family: 'Lucida Sans Unicode', 'Lucida Grande', Helvetica, Arial, sans-serif; font-size: 11px; line-height: 1.8; -webkit-text-size-adjust: none; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; margin-top: 8px; margin-right: 0px; margin-bottom: 8px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; word-break: normal; word-wrap: break-word; "&gt;&lt;span style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: 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; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; font-size: x-small; "&gt;在开发iphone 之前，首先需要从 苹果 iphone &amp;nbsp;开发网站上，下载所需的 SDK。 这个开发包 本身就带有 版本信息。 比如：下载 苹果最新发布的： &amp;nbsp; xcode_3.2.6_and_ios_sdk_4.3 &amp;nbsp;。 这个开发包表明： Xcode的版本号是： 3.2.6， 而 iOS SDK 的版本号 是 4.3.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="color: #444444; font-family: 'Lucida Sans Unicode', 'Lucida Grande', Helvetica, Arial, sans-serif; font-size: 11px; line-height: 1.8; -webkit-text-size-adjust: none; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; margin-top: 8px; margin-right: 0px; margin-bottom: 8px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; word-break: normal; word-wrap: break-word; "&gt;&lt;span style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: 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; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; font-size: x-small; "&gt;Xcode 中 iOS SDK 和 &amp;nbsp;iOS Deployment Target 的设置：&lt;br /&gt;Base SDK 指的是，当前编译所用的SDK 版本； OS Deployment Target &amp;nbsp;指的是，编译后的 app 可在 终端的哪个 版本上运行。&lt;/span&gt;&lt;/p&gt;&lt;p style="color: #444444; font-family: 'Lucida Sans Unicode', 'Lucida Grande', Helvetica, Arial, sans-serif; font-size: 11px; line-height: 1.8; -webkit-text-size-adjust: none; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; margin-top: 8px; margin-right: 0px; margin-bottom: 8px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; word-break: normal; word-wrap: break-word; "&gt;需对 Project 和 Target 分别设置：&lt;br /&gt;1. Project 设置方法：&lt;br /&gt;（1）从 Xcode &amp;nbsp;Menu， 逐级进入 &amp;nbsp;Project －&amp;gt; Edit Project Settings -&amp;gt; Build -&amp;gt; &amp;nbsp;Base SDK&lt;br /&gt;（2）以同样方式进入 &amp;nbsp;iOS &amp;nbsp;Deployment Target&lt;br /&gt;2. Target 设置方法：&lt;br /&gt;（1）从 Xcode &amp;nbsp;Menu， 逐级进入 &amp;nbsp;Project －&amp;gt; Edit Active &amp;nbsp;Target &amp;nbsp;-&amp;gt; Build -&amp;gt; &amp;nbsp;Base SDK&lt;br /&gt;（2）以同样方式进入 &amp;nbsp;iOS &amp;nbsp;Deployment Target&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p style="color: #444444; font-family: 'Lucida Sans Unicode', 'Lucida Grande', Helvetica, Arial, sans-serif; font-size: 11px; line-height: 1.8; -webkit-text-size-adjust: none; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; margin-top: 8px; margin-right: 0px; margin-bottom: 8px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; word-break: normal; word-wrap: break-word; "&gt;&lt;/p&gt;&lt;p style="color: #444444; font-family: 'Lucida Sans Unicode', 'Lucida Grande', Helvetica, Arial, sans-serif; font-size: 11px; line-height: 1.8; -webkit-text-size-adjust: none; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; margin-top: 8px; margin-right: 0px; margin-bottom: 8px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; word-break: normal; word-wrap: break-word; "&gt;&lt;span style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: 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; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; font-size: x-small; "&gt;注意： 确保 Project &amp;nbsp;和 Target 的设置 保持一致。&lt;/span&gt;&lt;/p&gt;&lt;p style="color: #444444; font-family: 'Lucida Sans Unicode', 'Lucida Grande', Helvetica, Arial, sans-serif; font-size: 11px; line-height: 1.8; -webkit-text-size-adjust: none; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; margin-top: 8px; margin-right: 0px; margin-bottom: 8px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; word-break: normal; word-wrap: break-word; "&gt;&lt;span style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: 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; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; font-size: x-small; "&gt;这里 以 Flex Radio （一款 网络电台）设置为例。&lt;/span&gt;&lt;/p&gt;&lt;p style="color: #444444; font-family: 'Lucida Sans Unicode', 'Lucida Grande', Helvetica, Arial, sans-serif; font-size: 11px; line-height: 1.8; -webkit-text-size-adjust: none; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; margin-top: 8px; margin-right: 0px; margin-bottom: 8px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; word-break: normal; word-wrap: break-word; "&gt;&lt;span style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: 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; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; font-size: x-small; "&gt;&amp;nbsp;Base SDK 设置为：&amp;nbsp; iOS&amp;nbsp; 4.1&lt;/span&gt;&lt;/p&gt;&lt;p style="color: #444444; font-family: 'Lucida Sans Unicode', 'Lucida Grande', Helvetica, Arial, sans-serif; font-size: 11px; line-height: 1.8; -webkit-text-size-adjust: none; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; margin-top: 8px; margin-right: 0px; margin-bottom: 8px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; word-break: normal; word-wrap: break-word; "&gt;&lt;span style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: 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; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; font-size: x-small; "&gt;&amp;nbsp; iOS &amp;nbsp;Deployment Target&amp;nbsp;&amp;nbsp; 设置为：3.2 。&lt;br /&gt;通过这个设置， 编译出来的 ipa 文件 便可在 iphone 3.2 以上版本 安装。&lt;/span&gt;&lt;/p&gt;&lt;p style="color: #444444; font-family: 'Lucida Sans Unicode', 'Lucida Grande', Helvetica, Arial, sans-serif; font-size: 11px; line-height: 1.8; -webkit-text-size-adjust: none; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; margin-top: 8px; margin-right: 0px; margin-bottom: 8px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; word-break: normal; word-wrap: break-word; "&gt;&lt;span style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: 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; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; font-size: x-small; "&gt;&amp;nbsp;有时会发生一个怪异的现象： 若你的 iPhone 版本为 4.3， 而开发 SDK 为 4.1 ,&amp;nbsp; 在 XCode&amp;nbsp; Build &amp;amp;Go 时，会提示错误： iphone 版本太低，无法下载。 而且 在 XCode&amp;nbsp; windows-&amp;gt; Organizer 下 该 iphone 图标显示为 黄色， 而只有 绿色 才能正确下载。&lt;/span&gt;&lt;/p&gt;&lt;p style="color: #444444; font-family: 'Lucida Sans Unicode', 'Lucida Grande', Helvetica, Arial, sans-serif; font-size: 11px; line-height: 1.8; -webkit-text-size-adjust: none; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; margin-top: 8px; margin-right: 0px; margin-bottom: 8px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; word-break: normal; word-wrap: break-word; "&gt;&lt;span style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: 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; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; font-size: x-small; "&gt;怎么办呢？&amp;nbsp; 这里给出一个小窍门：&lt;/span&gt;&lt;/p&gt;&lt;p style="color: #444444; font-family: 'Lucida Sans Unicode', 'Lucida Grande', Helvetica, Arial, sans-serif; font-size: 11px; line-height: 1.8; -webkit-text-size-adjust: none; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; margin-top: 8px; margin-right: 0px; margin-bottom: 8px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; word-break: normal; word-wrap: break-word; "&gt;&lt;span style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: 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; outline-width: 0px; outline-style: initial; outline-color: initial; vertical-align: baseline; font-size: x-small; "&gt;在你的 Mac OS 上 安装 SDK 4.3 。 打开 SDK 4.3 版本的XCode， 并将 你手头的iphone （比如： 4.3 版本） 与 mac book 相连。 黄灯会变为 绿灯。 这时，再切换到到 4.1 版本的XCode,&amp;nbsp;&amp;nbsp; 便可正常下载到 4.3 版本的 iphone 上。&lt;/span&gt;&lt;/p&gt;&lt;p style="color: #444444; font-family: 'Lucida Sans Unicode', 'Lucida Grande', Helvetica, Arial, sans-serif; font-size: 11px; line-height: 1.8; -webkit-text-size-adjust: none; "&gt;&lt;/p&gt;&lt;p style="color: #444444; font-family: 'Lucida Sans Unicode', 'Lucida Grande', Helvetica, Arial, sans-serif; font-size: 11px; line-height: 1.8; -webkit-text-size-adjust: none; "&gt;&lt;strong style="color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; font-size: 14px; line-height: 20px; text-align: -webkit-auto; -webkit-text-size-adjust: auto; background-color: #efefef; "&gt;IOS SDK&lt;/strong&gt;&lt;span style="color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; font-size: 14px; line-height: 20px; text-align: -webkit-auto; -webkit-text-size-adjust: auto; background-color: #efefef; "&gt;兼容性引导&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="background-color: #efefef; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; "&gt;转自:&amp;nbsp;&lt;/span&gt;&lt;a href="http://mobile.51cto.com/iphone-284052.htm" style="background-color: #efefef; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; color: #678098; text-shadow: rgba(255, 255, 255, 0.496094) 0px 1px 0px; display: inline; "&gt;http://mobile.51cto.com/iphone-284052.htm&lt;/a&gt;&lt;/p&gt;&lt;div&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;&lt;strong&gt;IOS SDK&lt;/strong&gt;兼容性引导是本文要介绍的内容，主要是基于&lt;strong&gt;IOS SDK&lt;/strong&gt;基础的开发介绍说明如何应用于XCode工程的基于&lt;strong&gt;IOS SDK&lt;/strong&gt;开发的技术。来看详细内容讲解。&lt;/p&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;1、用(weakly linked)弱连接类、方法和函数来支持在不同版本之间的程序运行&lt;/p&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;2、弱连接整个框架(framework)&lt;/p&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;3、为不同的IOS SDK选择不同的编译条件&lt;/p&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;4、在代码中找出过时API的使用&lt;/p&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;5、确定在运行时操作系统和框架(framework)的版本&lt;/p&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;&lt;strong&gt;一 、在IOS中使用弱连接类&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;在工程中使用类的弱连接的时候必须确保这些类在运行时的可用性，要不会引起动态连接的错误。&lt;/p&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;在IOS4.2以后的版本都是使用NSObject class的方法来检测弱连接在运行时态的可用性，这种简单高效的机制使用了NS_CLASS_AVAILABLE的可用性宏。&lt;/p&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;检测最近release的framework还不支持NS_CLASS_AVAILABLE的宏&lt;/p&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;在支持NS_CLASS_AVAILABLE的宏framework的条件编译中，可以如下的使用&lt;/p&gt;&lt;ol style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: disc !important; list-style-position: inside !important; list-style-image: initial !important; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;if&amp;nbsp;([UIPrintInteractionController&amp;nbsp;class])&amp;nbsp;{&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;Create&amp;nbsp;an&amp;nbsp;instance&amp;nbsp;of&amp;nbsp;the&amp;nbsp;class&amp;nbsp;and&amp;nbsp;use&amp;nbsp;it.&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;}&amp;nbsp;else&amp;nbsp;{&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;Alternate&amp;nbsp;code&amp;nbsp;path&amp;nbsp;to&amp;nbsp;follow&amp;nbsp;when&amp;nbsp;the&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;class&amp;nbsp;is&amp;nbsp;not&amp;nbsp;available.&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;}&amp;nbsp;&lt;/li&gt;&lt;/ol&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;如果你在不确保是否已经可以使用类方法的时候你可以使用NSClassFromString 方法来判断，使用方法如下:&lt;/p&gt;&lt;ol style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: disc !important; list-style-position: inside !important; list-style-image: initial !important; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;Class&amp;nbsp;cls&amp;nbsp;=&amp;nbsp;NSClassFromString&amp;nbsp;(@"NSRegularExpression");&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;if&amp;nbsp;(cls)&amp;nbsp;{&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;Create&amp;nbsp;an&amp;nbsp;instance&amp;nbsp;of&amp;nbsp;the&amp;nbsp;class&amp;nbsp;and&amp;nbsp;use&amp;nbsp;it.&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;}&amp;nbsp;else&amp;nbsp;{&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;Alternate&amp;nbsp;code&amp;nbsp;path&amp;nbsp;to&amp;nbsp;follow&amp;nbsp;when&amp;nbsp;the&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;class&amp;nbsp;is&amp;nbsp;not&amp;nbsp;available.&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;}&amp;nbsp;&lt;/li&gt;&lt;/ol&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;&lt;strong&gt;二、在方法，函数和符号中使用弱连接&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;和使用类的弱连接一样，在使用它之前要确保方法函数和符号在运行时的可用性，要不在编译的时候会报错动态连接错误，假设你想使用新版本IOS&amp;nbsp;&lt;br /&gt;SDK的特性但是又想能够运行在低版本的SDK中，那么就要对早期的版本设置相应的开发target，在Object-c中&amp;nbsp;&lt;br /&gt;instancesRespondToSelector:&amp;nbsp;&lt;br /&gt;方法告诉我们所给的方法是否可用，例如:使用availableCaptureModesForCameraDevice:这个方法(在4.0以后才是可&lt;br /&gt;用的)，我们可以这样使用它。&lt;/p&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;1、检查一个Object-c方法的可用性&lt;/p&gt;&lt;ol style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: disc !important; list-style-position: inside !important; list-style-image: initial !important; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;if&amp;nbsp;([UIImagePickerController&amp;nbsp;instancesRespondToSelector:&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@selector&amp;nbsp;(availableCaptureModesForCameraDevice:)])&amp;nbsp;{&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;Method&amp;nbsp;is&amp;nbsp;available&amp;nbsp;for&amp;nbsp;use.&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;Your&amp;nbsp;code&amp;nbsp;can&amp;nbsp;check&amp;nbsp;if&amp;nbsp;video&amp;nbsp;capture&amp;nbsp;is&amp;nbsp;available&amp;nbsp;and,&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;if&amp;nbsp;it&amp;nbsp;is,&amp;nbsp;offer&amp;nbsp;that&amp;nbsp;option.&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;}&amp;nbsp;else&amp;nbsp;{&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;Method&amp;nbsp;is&amp;nbsp;not&amp;nbsp;available.&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;Alternate&amp;nbsp;code&amp;nbsp;to&amp;nbsp;use&amp;nbsp;only&amp;nbsp;still&amp;nbsp;image&amp;nbsp;capture.&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;}&amp;nbsp;&lt;/li&gt;&lt;/ol&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;判断一个弱连接的C函数是否可用，只要判断函数的地址是否返回为NULL，以CGColorCreateGenericCMYK 函数为例，我们可以像以下那样使用。&lt;/p&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;2、检查C方法的可用性&lt;/p&gt;&lt;ol style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: disc !important; list-style-position: inside !important; list-style-image: initial !important; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;if&amp;nbsp;(CGColorCreateGenericCMYK&amp;nbsp;!=&amp;nbsp;NULL)&amp;nbsp;{&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CGColorCreateGenericCMYK&amp;nbsp;(0.1,0.5.0.0,1.0,0.1);&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;}&amp;nbsp;else&amp;nbsp;{&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;Function&amp;nbsp;is&amp;nbsp;not&amp;nbsp;available.&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;Alternate&amp;nbsp;code&amp;nbsp;to&amp;nbsp;create&amp;nbsp;a&amp;nbsp;color&amp;nbsp;object&amp;nbsp;with&amp;nbsp;earlier&amp;nbsp;technology&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;&lt;/ol&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;要检测一个C方法是否可用，比较明确的为地址是否为NULL或零。你不能使用反运算符(!)来否定一个函数的可用性&lt;/p&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;检测一个 external(extern)常量或一个通知的名字应当比较它的地址(address)--而不是符号的名称， 判断是否为NULL or nil&lt;/p&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;&lt;strong&gt;三、弱连接整个Framework&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;比如一个在高版本中才出现的Framework，想在低版本使用他的特性。那你就必须弱连接那个使用的Framework，详见官方的图解---(其实就是在添加进去的Framework的 required 改成 optional)&lt;/p&gt;&lt;ol style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: disc !important; list-style-position: inside !important; list-style-image: initial !important; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;http://developer.apple.com/library/ios/#documentation/DeveloperTools/Conceptual/XcodeProjectManagement/&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;130-Files_in_Projects/project_files.html#//apple_ref/doc/uid/TP40002666-SW4&amp;nbsp;&lt;/li&gt;&lt;/ol&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;&lt;strong&gt;四、条件编译for不同的SDK&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;如果你不止基于一个IOS SDK编译，你就可能需要为base&amp;nbsp;&lt;br /&gt;sdk使用条件化，可以使用在Availability.h中的定义。这个.h文件存在于系统的文件夹/usr/include的文件夹下，例如想在&lt;br /&gt;Mac OS X v10.5(而不是IOS)中使用函数 CGColorCreateGenericCMYK&lt;/p&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;使用预处理指令for条件编译&lt;/p&gt;&lt;ol style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: disc !important; list-style-position: inside !important; list-style-image: initial !important; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;#ifdef&amp;nbsp;__MAC_OS_X_VERSION_MAX_ALLOWED&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;code&amp;nbsp;only&amp;nbsp;compiled&amp;nbsp;when&amp;nbsp;targeting&amp;nbsp;Mac&amp;nbsp;OS&amp;nbsp;X&amp;nbsp;and&amp;nbsp;not&amp;nbsp;iOS&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;note&amp;nbsp;use&amp;nbsp;of&amp;nbsp;1050&amp;nbsp;instead&amp;nbsp;of&amp;nbsp;__MAC_10_5&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;#if&amp;nbsp;__MAC_OS_X_VERSION_MAX_ALLOWED&amp;nbsp;&amp;gt;=&amp;nbsp;1050&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(CGColorCreateGenericCMYK&amp;nbsp;!=&amp;nbsp;NULL)&amp;nbsp;{&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CGColorCreateGenericCMYK(0.1,0.5.0.0,1.0,0.1);&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;else&amp;nbsp;{&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;#endif&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;code&amp;nbsp;to&amp;nbsp;create&amp;nbsp;a&amp;nbsp;color&amp;nbsp;object&amp;nbsp;with&amp;nbsp;earlier&amp;nbsp;technology&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;#if&amp;nbsp;__MAC_OS_X_VERSION_MAX_ALLOWED&amp;nbsp;&amp;gt;=&amp;nbsp;1050&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;#endif&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;#endif&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;}&amp;nbsp;&lt;/li&gt;&lt;/ol&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;&lt;strong&gt;五、寻找出在程序中使用的以过时的实例&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;在IOS或Mac&amp;nbsp;&lt;br /&gt;OS中有时候API会过时，但是过时不代表着那些就从Library或framework中删除，但是在使用的过程中会报出warning，并且在不远的&lt;br /&gt;将来可能会被Apple从中移除。例如我们在code中使用了过时的函数 HPurge那么就会报出如下&lt;/p&gt;&lt;ol style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: disc !important; list-style-position: inside !important; list-style-image: initial !important; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;'HPurge'&amp;nbsp;is&amp;nbsp;deprecated&amp;nbsp;(declared&amp;nbsp;at&amp;nbsp;/Users/steve/MyProject/main.c:51)&amp;nbsp;&lt;/li&gt;&lt;/ol&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;所以我们应当在工程中查找出如下的警告并且修改。&lt;/p&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;&lt;strong&gt;六、确定操作系统和Framework的版本&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;在运行时检查IOS的版本&lt;/p&gt;&lt;ol style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: disc !important; list-style-position: inside !important; list-style-image: initial !important; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;NSString&amp;nbsp;*osVersion&amp;nbsp;=&amp;nbsp;[[UIDevice&amp;nbsp;currentDevice]&amp;nbsp;systemVersion];&amp;nbsp;&lt;/li&gt;&lt;/ol&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;在运行时检查Mac OS X用Gestalt function 和 系统版本常量&lt;/p&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;另外，对于许多的Framework你可以在运行时检查指定Framework的版本。&lt;/p&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;例如：Application Kit(NSApplication.h)定义了NSAppKitVersionNumber常量---可以用来检查Application Kit Framework的版本&lt;/p&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;如&lt;/p&gt;&lt;ol style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: disc !important; list-style-position: inside !important; list-style-image: initial !important; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;APPKIT_EXTERN&amp;nbsp;double&amp;nbsp;NSAppKitVersionNumber;&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;#define&amp;nbsp;NSAppKitVersionNumber10_0&amp;nbsp;577&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;#define&amp;nbsp;NSAppKitVersionNumber10_1&amp;nbsp;620&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;#define&amp;nbsp;NSAppKitVersionNumber10_2&amp;nbsp;663&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;#define&amp;nbsp;NSAppKitVersionNumber10_2_3&amp;nbsp;663.6&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;#define&amp;nbsp;NSAppKitVersionNumber10_3&amp;nbsp;743&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;#define&amp;nbsp;NSAppKitVersionNumber10_3_2&amp;nbsp;743.14&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;#define&amp;nbsp;NSAppKitVersionNumber10_3_3&amp;nbsp;743.2&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;#define&amp;nbsp;NSAppKitVersionNumber10_3_5&amp;nbsp;743.24&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;#define&amp;nbsp;NSAppKitVersionNumber10_3_7&amp;nbsp;743.33&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;#define&amp;nbsp;NSAppKitVersionNumber10_3_9&amp;nbsp;743.36&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;#define&amp;nbsp;NSAppKitVersionNumber10_4&amp;nbsp;824&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;#define&amp;nbsp;NSAppKitVersionNumber10_4_1&amp;nbsp;824.1&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;#define&amp;nbsp;NSAppKitVersionNumber10_4_3&amp;nbsp;824.23&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;#define&amp;nbsp;NSAppKitVersionNumber10_4_4&amp;nbsp;824.33&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;#define&amp;nbsp;NSAppKitVersionNumber10_4_7&amp;nbsp;824.41&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;#define&amp;nbsp;NSAppKitVersionNumber10_5&amp;nbsp;949&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;#define&amp;nbsp;NSAppKitVersionNumber10_5_2&amp;nbsp;949.27&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;#define&amp;nbsp;NSAppKitVersionNumber10_5_3&amp;nbsp;949.33&amp;nbsp;&lt;/li&gt;&lt;/ol&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;所以我们可以像如下使用:&lt;/p&gt;&lt;ol style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: disc !important; list-style-position: inside !important; list-style-image: initial !important; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;if&amp;nbsp;(floor(NSAppKitVersionNumber)&amp;nbsp;&amp;lt;=&amp;nbsp;NSAppKitVersionNumber10_0)&amp;nbsp;{&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;&amp;nbsp;&amp;nbsp;/*&amp;nbsp;On&amp;nbsp;a&amp;nbsp;10.0.x&amp;nbsp;or&amp;nbsp;earlier&amp;nbsp;system&amp;nbsp;*/&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;}&amp;nbsp;else&amp;nbsp;if&amp;nbsp;(floor(NSAppKitVersionNumber)&amp;nbsp;&amp;lt;=&amp;nbsp;NSAppKitVersionNumber10_1)&amp;nbsp;{&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;&amp;nbsp;&amp;nbsp;/*&amp;nbsp;On&amp;nbsp;a&amp;nbsp;10.1&amp;nbsp;-&amp;nbsp;10.1.x&amp;nbsp;system&amp;nbsp;*/&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;}&amp;nbsp;else&amp;nbsp;if&amp;nbsp;(floor(NSAppKitVersionNumber)&amp;nbsp;&amp;lt;=&amp;nbsp;NSAppKitVersionNumber10_2)&amp;nbsp;{&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;&amp;nbsp;&amp;nbsp;/*&amp;nbsp;On&amp;nbsp;a&amp;nbsp;10.2&amp;nbsp;-&amp;nbsp;10.2.x&amp;nbsp;system&amp;nbsp;*/&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;}&amp;nbsp;else&amp;nbsp;if&amp;nbsp;(floor(NSAppKitVersionNumber)&amp;nbsp;&amp;lt;=&amp;nbsp;NSAppKitVersionNumber10_3)&amp;nbsp;{&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;&amp;nbsp;&amp;nbsp;/*&amp;nbsp;On&amp;nbsp;10.3&amp;nbsp;-&amp;nbsp;10.3.x&amp;nbsp;system&amp;nbsp;*/&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;}&amp;nbsp;else&amp;nbsp;if&amp;nbsp;(floor(NSAppKitVersionNumber)&amp;nbsp;&amp;lt;=&amp;nbsp;NSAppKitVersionNumber10_4)&amp;nbsp;{&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;&amp;nbsp;&amp;nbsp;/*&amp;nbsp;On&amp;nbsp;a&amp;nbsp;10.4&amp;nbsp;-&amp;nbsp;10.4.x&amp;nbsp;system&amp;nbsp;*/&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;}&amp;nbsp;else&amp;nbsp;if&amp;nbsp;(floor(NSAppKitVersionNumber)&amp;nbsp;&amp;lt;=&amp;nbsp;NSAppKitVersionNumber10_5)&amp;nbsp;{&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;&amp;nbsp;&amp;nbsp;/*&amp;nbsp;On&amp;nbsp;a&amp;nbsp;10.5&amp;nbsp;-&amp;nbsp;10.5.x&amp;nbsp;system&amp;nbsp;*/&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;}&amp;nbsp;else&amp;nbsp;{&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;&amp;nbsp;&amp;nbsp;/*&amp;nbsp;10.6&amp;nbsp;or&amp;nbsp;later&amp;nbsp;system&amp;nbsp;*/&amp;nbsp; &amp;nbsp;&lt;/li&gt;&lt;li style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; list-style-type: decimal !important; list-style-position: inside !important; list-style-image: initial !important; "&gt;}&amp;nbsp;&lt;/li&gt;&lt;/ol&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;跟以上一样在 NSObjCRuntime.h中用定义了NSFoundationVersionNumber全局常量&lt;/p&gt;&lt;p style="margin-top: 0px; margin-bottom: 0.5em; margin-right: 0px; margin-left: 0px; color: #333333; font-family: 'Microsoft Yahei', Tahoma, Arial, Helvetica, STHeiti; line-height: 20px; text-align: -webkit-auto; background-color: #efefef; "&gt;小结：详解&lt;strong&gt;IOS SDK&lt;/strong&gt;兼容性引导的内容介绍玩玩了，希望通过本文的学习能对你有所帮助！&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://www.cnblogs.com/Luoke365/aggbug/2318793.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/Luoke365/archive/2012/01/11/2318793.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/Luoke365/archive/2010/05/06/1729112.html</id><title type="text">中国地址的英文翻译</title><summary type="text">翻译原则：先小后大。中国人喜欢先说大的后说小的，如**区**路**号而外国人喜欢先说小的后说大的，如**号**路**区，因此您在翻译时就应该先写小的后写大的。 例如：中国山东省青岛市四方区洛阳路34号3号楼4单元402户，您就要从房开始写起，Room 402, Unit 4, Building 3, No.34. Luoyang Road, sifang District, Qingdao Cit...</summary><published>2010-05-06T11:21:00Z</published><updated>2010-05-06T11:21:00Z</updated><author><name>洛客</name><uri>http://www.cnblogs.com/Luoke365/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Luoke365/archive/2010/05/06/1729112.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Luoke365/archive/2010/05/06/1729112.html"/><content type="html">翻译原则：先小后大。&lt;br /&gt;中国人喜欢先说大的后说小的，如**区**路**号&lt;br /&gt;而外国人喜欢先说小的后说大的，如**号**路**区，因此您在翻译时就应该先写小的后写大的。 &lt;br /&gt;例如：中国山东省青岛市四方区洛阳路34号3号楼4单元402户，您就要从房开始写起，Room 402, Unit 4, Building 3, No.34. Luoyang Road, sifang District, Qingdao City, Shandong Prov, China&lt;br /&gt;（逗号后面有空格）。注意其中路名、公司名、村名等均不用翻译成同意的英文，只要照写拼音就行了。因为您的支票是中国的邮递员送过来，关键是要他们明白。技术大厦您写成Technology Building，他们可能更迷糊呢。&lt;br /&gt;&lt;br /&gt;现在每个城市的中国邮政信件分拣中心都有专人负责将外国来信地址翻译成中文地址,并写在信封上交下面邮递员送过来.&lt;br /&gt;&lt;br /&gt;重要: 你的邮政编码一定要写正确,因为外国信件中间的几道邮政环节都是*邮政编码区域投递的。&lt;br /&gt;&lt;br /&gt;常见中英文对照 &lt;br /&gt;***室/房 Room *** ***村 *** Vallage &lt;br /&gt;***号 No.*** ***号宿舍 *** Dormitory &lt;br /&gt;***楼/层 ***/F ***住宅区/小区 *** Residential Quater &lt;br /&gt;甲/乙/丙/丁 A/B/C/D ***巷 / 弄 Lane *** &lt;br /&gt;***单元 Unit *** ***号楼 / 栋 *** Building &lt;br /&gt;***公司 ***Com.&lt;br /&gt;*** Crop&lt;br /&gt;***LTD.CO ***厂 *** Factory &lt;br /&gt;***酒楼/酒店 *** Hotel ***路 *** Road &lt;br /&gt;***花园 *** Garden ***街 *** Street &lt;br /&gt;***信箱 Mailbox *** ***区 *** District &lt;br /&gt;***县 *** County ***镇 *** Town &lt;br /&gt;***市 *** City ***省 *** Prov. &lt;br /&gt;***院 ***Yard ***大学 ***College &lt;br /&gt;&lt;br /&gt;**表示序数词，比如1st、2nd、3rd、4th&amp;#8230;&amp;#8230;如果不会，就用No.***代替，或者直接填数字吧！&lt;br /&gt;另外有一些***里之类难翻译的东西，就直接写拼音*** Li。而***东（南、西、北）路，直接用拼音也行，写*** East（South、West、North）Road也行。还有，如果地方不够可以将7栋3012室写成：7-3012。 &lt;br /&gt;201室: Room 201&lt;br /&gt;12号: No.12&lt;br /&gt;2单元: Unit 2&lt;br /&gt;3号楼: Building No.3&lt;br /&gt;长安街: Chang An street&lt;br /&gt;南京路: Nanjing road&lt;br /&gt;长安公司: Chang An Company&lt;br /&gt;宝山区: BaoShan District&lt;br /&gt;赵家酒店: ZhaoJia hotel&lt;br /&gt;钱家花园: Qianjia garden&lt;br /&gt;孙家县: Sunjia county&lt;br /&gt;李家镇: Lijia town&lt;br /&gt;广州市: Guangzhou city&lt;br /&gt;广东省: Guangdong province&lt;br /&gt;中国: China&lt;br /&gt;&lt;br /&gt;实例：&lt;br /&gt;&lt;br /&gt;宝山区南京路12号3号楼201室&lt;br /&gt;room 201，building No.3,No.12，nanjing road，BaoShan District&lt;br /&gt;如果地方不够可以将3号楼201室写成：3-201&lt;br /&gt;&lt;br /&gt;宝山区示范新村37号403室&lt;br /&gt;Room 403,No.37,SiFan Residential Quarter,BaoShan District&lt;br /&gt;&lt;br /&gt;中华人民共和国民政部政策研究中心北京河沿大街147号&lt;br /&gt;No.147# HeiYian Street the policy center of civil administration department the People&amp;#8217;Republic of China&lt;br /&gt;&lt;br /&gt;虹口区西康南路125弄34号201室&lt;br /&gt;Room 201,No.34,Lane 125,XiKang Road(South),HongKou District&lt;br /&gt;&lt;br /&gt;北京市崇文区天坛南里西区20楼3单元101&lt;br /&gt;Room 3-101 building No.20,TianTan-NanXiLi Residential ChongWen District BeiJing City&lt;br /&gt;&lt;br /&gt;江苏省扬州市宝应县泰山东村102栋204室&lt;br /&gt;Room 204 building No.102, East TaiShan Residential BaoYin County JiangSu Province&lt;br /&gt;&lt;br /&gt;473004河南省南阳市中州路42号 刘刚&lt;br /&gt;Liu Gang，Room 42，Zhongzhou Road，Nanyang City，Henan Prov.China 473004&lt;br /&gt;&lt;br /&gt;中国四川省江油市川西北矿区采气一队&lt;br /&gt;1 Team CaiQi ChuanXiBei Mining Area JiangYou City SiChuan Province China&lt;br /&gt;&lt;br /&gt;中国河北省邢台市群众艺术馆&lt;br /&gt;The Masses Art Centre XinTai City HeBei Prov.China&lt;br /&gt;&lt;br /&gt;江苏省吴江市平望镇联北村七组&lt;br /&gt;7 Group LiBei Village PingWang Town WeJiang City JiangSu Province&lt;br /&gt;&lt;br /&gt;434000湖北省荆州市红苑大酒店 刘刚&lt;br /&gt;Liu Gang，Hongyuan Hotel，Jingzhou city，Hubei Prov， China 434000&lt;br /&gt;&lt;br /&gt;473000河南南阳市八一路272号特钢公司 刘刚&lt;br /&gt;Liu Gang，Special Steel Corp，No.272，Bayi Road，Nanyang City，Henan Prov. China 473000&lt;br /&gt;&lt;br /&gt;528400广东中山市东区亨达花园7栋702 刘刚&lt;br /&gt;Liu Gang&lt;br /&gt;Room 702，7th Building，Hengda Garden，East District，Zhongshan，China 528400&lt;br /&gt;&lt;br /&gt;361012福建省厦门市莲花五村龙昌里34号601室 刘刚&lt;br /&gt;Liu Gang，Room 601， No.34 Long Chang Li，Xiamen, Fujian, China 361012&lt;br /&gt;&lt;br /&gt;361004厦门公交总公司承诺办 刘刚&lt;br /&gt;Mr. Liu Gang，Cheng Nuo Ban，Gong Jiao Zong Gong Si，Xiamen Fujian, China 361004&lt;br /&gt;&lt;br /&gt;广东省广州中山路3号 ，No.3,ZhongShan Road,Guangzhou,GuangDong &lt;img src="http://www.cnblogs.com/Luoke365/aggbug/1729112.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/Luoke365/archive/2010/05/06/1729112.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/Luoke365/archive/2010/02/24/1672986.html</id><title type="text">重构的概念</title><summary type="text">重构的定义　　重构(名词):对软件内部结构的一种调整,目的是在不改变"软件之可察行为"前提下,提高其可理解性,降低其修改成本.　　重构(动词):使用一系列重构准则(手法),在不改变"软件之可察行为"前提下,调整其结构.　　两种定义都强调是在不改变"软件的外部行为"前提下,不改变"软件之可察行为"就是说让修改不影响外部使用程序(程序员),在个外部来看,程序的行为和结果没有任何的变化.重构只是对程序内...</summary><published>2010-02-24T13:40:00Z</published><updated>2010-02-24T13:40:00Z</updated><author><name>洛客</name><uri>http://www.cnblogs.com/Luoke365/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Luoke365/archive/2010/02/24/1672986.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Luoke365/archive/2010/02/24/1672986.html"/><content type="html">　　&lt;strong&gt;重构的定义&lt;/strong&gt;&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　重构(名词):对软件内部结构的一种调整,目的是在不改变"软件之可察行为"前提下,提高其可理解性,降低其修改成本.&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　重构(动词):使用一系列重构准则(手法),在不改变"软件之可察行为"前提下,调整其结构.&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　两种定义都强调是在不改变"软件的外部行为"前提下,不改变"软件之可察行为"就是说让修改不影响外部使用程序(程序员),在个外部来看,程序的行为和结果没有任何的变化.重构只是对程序内部结构进行调整,让代码更加容易理解,然后更容易维护.&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　&lt;strong&gt;重构的好处&lt;/strong&gt;&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　能改进软件设计使软件更容易被理解&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　能帮你找到bug&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　提高软件的开发速度&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　&lt;strong&gt;什么时候进行重构&lt;/strong&gt;&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　三次法则:事不过三,三则重构.意思是说,一件事情,第一次只管去做,第二次做类似的事情会产生反感,但无论如何还是做了,第三次再做类似的事情,你就应该重构.&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　在添加新功能时进行重构.&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　在修改bug时进行重构&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　在代码复审时进行重构.&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　&lt;strong&gt;为什么重构有用&lt;/strong&gt;&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　难以修改的程序具有以下特征:&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　难以阅读的程序,难以修改&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　逻辑重复的程序,难以修改&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　添加新行为时需要修改现有的代码,难以修改&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　带复杂条件逻辑的程序,难以修改&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　好的程序应该是:&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　容易阅读&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　所有逻辑都只在惟一地点指定&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　新的改动不会危及现有的行为&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　尽可能简单的表达条件逻辑&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　&lt;strong&gt;间接层和重构&lt;/strong&gt;&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　间接层的存在的价值:允许逻辑共享；分开解释意图和实现；将变化加以隔离；将条伯逻辑加以编码&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　但是过多的间接层会导致代码的层次太深,使代码难以阅读.因些要权衡加入间接层的利弊.&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　&lt;strong&gt;重构的难题&lt;/strong&gt;&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　关系数据库与&lt;a href="http://baike.baidu.com/view/125370.htm" target="_blank"&gt;面向对象&lt;/a&gt;编程的问题&amp;#8212;&amp;#8212;在对象模型和数据库模型之间插入一个分隔层,这就可以隔离两个模型各自的变化.升级某一模型时无需同时升级上述的分隔层即可.这样的分隔层会增加系统复杂度.但是能增加灵活度.&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　修改接口的问题&amp;#8212;&amp;#8212;修改已发布的接口,因为已发布的接口会供外部人员(其它公司)使用,因此,修改接口会导致引用接口的其它程序不修改程序就无法运行.修改接口的最好的办法是增加一个新的接口,让旧接口调用新接口.这样原来的程序就不用修改了.对于接口的另一个建议是心尽量不要发布接口.&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　&lt;strong&gt;什么时候不进行重构&lt;/strong&gt;&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　现有的程序无法运行,此时应该是重写程序,而不是重构程序&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　到了最后的交付期限&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　&lt;strong&gt;重构与设计&lt;/strong&gt;&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　重构与设计是互补的,程序应该是先设计,而在开始编码后,设计上的不足可以用重构来弥补.设计应该是适度的设计,而不必过度的设计.如果能很容易的通过重构来适应需求的变化,那么就不必过度的设计,当需求改变时再重构代码.&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　&lt;strong&gt;重构与性能&lt;/strong&gt;&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　提高性能的三种方法:&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　时间预算法&amp;#8212;&amp;#8212;在设计时就对程序花费的时间进行预算,通常用于性能要求极高的实时系统.普通的企业应用程序一般对性能要求不高.只要不太慢就可以了.&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　持续关注法&amp;#8212;&amp;#8212;要求程序员在任何时间都要设法保持系统的高性能.这个方法有个缺陷,就是大部分的程序90%的优化工作都是白费劲,这样会浪费大量的时间.&lt;br /&gt;&#xD;
&lt;div &gt;&lt;/div&gt;　　良好的分解方式&amp;#8212;&amp;#8212;这个方式是在开发程序阶段不对性能投以任何关注,直到进入性能优化阶段,再分析程序中性能差的程序,然后对这些程序进分解,查出性能差的程序,进行优化&#xD;
&lt;p align="justify"&gt;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/Luoke365/aggbug/1672986.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/Luoke365/archive/2010/02/24/1672986.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/Luoke365/archive/2010/02/04/1663986.html</id><title type="text">WCF RIA Services DomainService life-cycle and adding Transactions</title><summary type="text">Note: This blog post will use the WCF RIA Services PDC Beta and VS2010 Preview, changes to the framework can me made before it hits RTM.Some questions that pops up about WCF RIA Services is how to ena...</summary><published>2010-02-04T14:25:00Z</published><updated>2010-02-04T14:25:00Z</updated><author><name>洛客</name><uri>http://www.cnblogs.com/Luoke365/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Luoke365/archive/2010/02/04/1663986.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Luoke365/archive/2010/02/04/1663986.html"/></entry><entry><id>http://www.cnblogs.com/Luoke365/archive/2010/02/04/1663984.html</id><title type="text">Silverlight 3 RIA服务编程中使用自定义方法及服务操作</title><summary type="text">第1页：创建Silverlight 3示例工程第2页：LINQ to SQL数据模型的添加和域服务第3页：Silverlight用户界面及基本后台代码编程第4页：编写应用程序逻辑 第5页：普通服务的操作和声明第6页：运行结果第7页：有关域的重要补充第8页：全文小结展开全部 文本Tag： Visual Studio 微软 web开发 RIA Silverlight 　【IT168专稿】在基于Silv...</summary><published>2010-02-04T14:24:00Z</published><updated>2010-02-04T14:24:00Z</updated><author><name>洛客</name><uri>http://www.cnblogs.com/Luoke365/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Luoke365/archive/2010/02/04/1663984.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Luoke365/archive/2010/02/04/1663984.html"/></entry><entry><id>http://www.cnblogs.com/Luoke365/archive/2010/01/20/1651991.html</id><title type="text">HP大中华区总裁孙振耀退休感言</title><summary type="text">一、关于工作与生活我有个有趣的观察，外企公司多的是25-35岁的白领，40岁以上的员工很少，二三十岁的外企员工是意气风发的，但外企公司40岁附近的经理人是很尴尬的。我见过的40岁附近的外企经理人大多在一直跳槽，最后大多跳到民企，比方说，唐骏。外企员工的成功很大程度上是公司的成功，并非个人的成功，西门子的确比国美大，但并不代表西门子中国经理比国美的老板强，甚至可以说差得很远。而进外企的人往往并不能很...</summary><published>2010-01-19T16:07:00Z</published><updated>2010-01-19T16:07:00Z</updated><author><name>洛客</name><uri>http://www.cnblogs.com/Luoke365/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Luoke365/archive/2010/01/20/1651991.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Luoke365/archive/2010/01/20/1651991.html"/></entry><entry><id>http://www.cnblogs.com/Luoke365/archive/2009/12/10/1621474.html</id><title type="text">C#泛型</title><summary type="text">C#泛型类与结构C#除可单独声明泛型类型（包括类与结构）外，也可在基类中包含泛型类型的声明。但基类如果是泛型类，它的类型参数要么已实例化，要么来源于子类（同样是泛型类型）声明的类型参数。class C&amp;lt;U, V&amp;gt; {} //合法class D: C&amp;lt;string,int&amp;gt;{} //合法class E&amp;lt;U, V&amp;gt;: C&amp;lt;U, V&amp;gt; {} //合法cla...</summary><published>2009-12-10T15:19:00Z</published><updated>2009-12-10T15:19:00Z</updated><author><name>洛客</name><uri>http://www.cnblogs.com/Luoke365/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Luoke365/archive/2009/12/10/1621474.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Luoke365/archive/2009/12/10/1621474.html"/></entry><entry><id>http://www.cnblogs.com/Luoke365/archive/2009/11/05/1596995.html</id><title type="text">Session莫名丢失的原因及解决办法</title><summary type="text">Asp.net默认配置下，Session莫名丢失的原因及解决办法正常操作情况下Session会无故丢失。因为程序是在不停的被操作，排除Session超时的可能。另外，Session超时时间被设定成60分钟，不会这么快就超时的。这次到CSDN上搜了一下帖子，发现好多人在讨论这个问题，然后我又google了一下，发现微软网站上也有类似的内容。现在我就把原因和解决办法写出来。原因：由于Asp.net程序...</summary><published>2009-11-05T13:58:00Z</published><updated>2009-11-05T13:58:00Z</updated><author><name>洛客</name><uri>http://www.cnblogs.com/Luoke365/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Luoke365/archive/2009/11/05/1596995.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Luoke365/archive/2009/11/05/1596995.html"/></entry><entry><id>http://www.cnblogs.com/Luoke365/archive/2009/03/22/1419097.html</id><title type="text">在SQL Server 2005中实现 Server.UrlEncode、Server.UrlDecode</title><summary type="text"/><published>2009-03-22T10:16:00Z</published><updated>2009-03-22T10:16:00Z</updated><author><name>洛客</name><uri>http://www.cnblogs.com/Luoke365/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Luoke365/archive/2009/03/22/1419097.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Luoke365/archive/2009/03/22/1419097.html"/></entry><entry><id>http://www.cnblogs.com/Luoke365/archive/2009/02/18/1393380.html</id><title type="text">商品條碼</title><summary type="text"/><published>2009-02-18T10:00:00Z</published><updated>2009-02-18T10:00:00Z</updated><author><name>洛客</name><uri>http://www.cnblogs.com/Luoke365/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Luoke365/archive/2009/02/18/1393380.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Luoke365/archive/2009/02/18/1393380.html"/></entry></feed>
