<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>iPhoneGeek 爱疯极客 &#187; 浏览器</title>
	<atom:link href="http://www.iphone-geek.cn/tag/%e6%b5%8f%e8%a7%88%e5%99%a8/feed" rel="self" type="application/rss+xml" />
	<link>http://www.iphone-geek.cn</link>
	<description>iPhone 新闻，编程，技巧与提示，代码，教程</description>
	<lastBuildDate>Sun, 25 Jul 2010 13:49:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>创建离线iPhone Web App</title>
		<link>http://www.iphone-geek.cn/%e7%bc%96%e7%a8%8b/%e5%88%9b%e5%bb%ba%e7%a6%bb%e7%ba%bfiphone-web-app</link>
		<comments>http://www.iphone-geek.cn/%e7%bc%96%e7%a8%8b/%e5%88%9b%e5%bb%ba%e7%a6%bb%e7%ba%bfiphone-web-app#comments</comments>
		<pubDate>Tue, 18 May 2010 05:09:21 +0000</pubDate>
		<dc:creator>bagusflyer</dc:creator>
				<category><![CDATA[编程]]></category>
		<category><![CDATA[网络]]></category>
		<category><![CDATA[Web App]]></category>
		<category><![CDATA[教程]]></category>
		<category><![CDATA[浏览器]]></category>

		<guid isPermaLink="false">http://www.iphone-geek.cn/?p=952</guid>
		<description><![CDATA[创建Web App的好处很多，比如：


可以运行在任何平台上 （当然要考虑浏览器的兼容性和屏幕大小问题） 
不需要学习iPhone编程语言 
最大的好处是不需要经过App Store批准 


随着Internet技术的迅速发展，使得Web App越来越强大，从简单的应用甚至到游戏，都可能通过Web App实现。但是，它要求随时连接到Internet，大大降低了Web App的实用性。随着Safari对HTML 5的支持，使得Web App的离线运行成为可能。这意味着你可以在没有Internet连接的情况下运行你的应用程序。

下面的例子改编自How to Make an HTML5 iPhone App，它介绍了创建一个离线“积木”游戏的全过程，我加上了创建用户自定义的桌面图标和启动画面的方法，使它看上去完全像一个真正的iPhone应用程序，而这是完全不需要通过Apple的App Store批准的。


基本要求

网页编程技术：HTML(5)， CSS 以及 JavaScript。

准备工作

由于我们要利用HTML5的离线缓存技术，我们需要访问网页服务器以便对文件的HTTP Headers进行修改（稍后我们会详细讨论）。

Apache服务器很容易通过修改 .htaccess 文件完成你需要的工作。这里是一篇教程关于 m使用htaccess修改HTTP header。

然后你需要打开Safari浏览器的调试窗以帮助你进行调试。在Settings > Safari > Developer中打开调试终端，它能够帮助你发现一些潜在的Javascript错误。记住在完成调试后，关闭调试窗。



应用程序缓存

HTML5 有关离线的标准参考这里。

应用程序缓存允许浏览器预先确定网页所需的所有文件，然后它将保存这些文件。格式是绝对地址如http://yourwebserver.com/picture.png 或者相对地址(/picture.png)，浏览器将离线保存这些文件。

你还可以列出不需要缓存的URL。最主要的部分是清单文件（需要离线缓存文件的清单）在Http Header中的filetype必须设置为text/manifest。


屏幕尺寸

在设计iPhone Web App时必须注意，当处于app模式时，屏幕尺寸为 320px X 460px，而在web模式时为 320px X 356px。这也许会影响你的用户界面设计。




代码

12345678910111213141516&#60;!DOCTYPE html&#62;
&#60;html manifest=&#34;tetris.manifest&#34;&#62;
&#60;head&#62;
&#160; &#160; &#60;meta name=&#34;viewport&#34; content=&#34;user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0&#34;/&#62;
&#160; &#160; &#60;meta name=&#34;apple-mobile-web-app-capable&#34; content=&#34;yes&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>创建Web App的好处很多，比如：</p>
<p><br class="spacer_" /></p>
<ul>
<li>可以运行在任何平台上 （当然要考虑浏览器的兼容性和屏幕大小问题） </li>
<li>不需要学习iPhone编程语言 </li>
<li>最大的好处是不需要经过App Store批准 </li>
</ul>
<p><br class="spacer_" /></p>
<p>随着Internet技术的迅速发展，使得Web App越来越强大，从简单的应用甚至到游戏，都可能通过Web App实现。但是，它要求随时连接到Internet，大大降低了Web App的实用性。随着Safari对HTML 5的支持，使得Web App的离线运行成为可能。这意味着你可以在没有Internet连接的情况下运行你的应用程序。</p>
<p><br class="spacer_" /></p>
<p>下面的例子改编自<a href="http://sixrevisions.com/web-development/html5-iphone-app/">How to Make an HTML5 iPhone App</a>，它介绍了创建一个离线“积木”游戏的全过程，我加上了创建用户自定义的桌面图标和启动画面的方法，使它看上去完全像一个真正的iPhone应用程序，而这是完全不需要通过Apple的App Store批准的。</p>
<p><span id="more-952"></span></p>
<p><br class="spacer_" /></p>
<h3>基本要求</h3>
<p><br class="spacer_" /></p>
<p>网页编程技术：HTML(5)， CSS 以及 JavaScript。</p>
<p><br class="spacer_" /></p>
<h3>准备工作</h3>
<p><br class="spacer_" /></p>
<p>由于我们要利用HTML5的离线缓存技术，我们需要访问网页服务器以便对文件的<a href="http://en.wikipedia.org/wiki/List_of_HTTP_headers">HTTP Headers</a>进行修改（稍后我们会详细讨论）。</p>
<p><br class="spacer_" /></p>
<p>Apache服务器很容易通过修改 .htaccess 文件完成你需要的工作。这里是一篇教程关于 <a href="http://www.askapache.com/htaccess/using-http-headers-with-htaccess.html">m使用htaccess修改HTTP header</a>。</p>
<p><br class="spacer_" /></p>
<p>然后你需要打开Safari浏览器的调试窗以帮助你进行调试。在Settings > Safari > Developer中打开调试终端，它能够帮助你发现一些潜在的Javascript错误。记住在完成调试后，关闭调试窗。</p>
<p><br class="spacer_" /></p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.iphone-geek.cn/wp-content/uploads/2010/05/image3.png" border="0" alt="image" width="324" height="484" /></p>
<p><br class="spacer_" /></p>
<h3>应用程序缓存</h3>
<p><br class="spacer_" /></p>
<p>HTML5 有关离线的标准参考这里。</p>
<p><br class="spacer_" /></p>
<p>应用程序缓存允许浏览器预先确定网页所需的所有文件，然后它将保存这些文件。格式是绝对地址如<a href="http://yourwebserver.com/picture.png">http://yourwebserver.com/picture.png</a> 或者相对地址(/picture.png)，浏览器将离线保存这些文件。</p>
<p><br class="spacer_" /></p>
<p>你还可以列出不需要缓存的URL。最主要的部分是清单文件（需要离线缓存文件的清单）在Http Header中的filetype必须设置为text/manifest。</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<h3>屏幕尺寸</h3>
<p><br class="spacer_" /></p>
<p>在设计iPhone Web App时必须注意，当处于app模式时，屏幕尺寸为 320px X 460px，而在web模式时为 320px X 356px。这也许会影响你的用户界面设计。</p>
<p><br class="spacer_" /></p>
<p><a href="http://www.iphone-geek.cn/wp-content/uploads/2010/05/image4.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.iphone-geek.cn/wp-content/uploads/2010/05/image_thumb.png" border="0" alt="image" width="554" height="417" /></a></p>
<p><br class="spacer_" /></p>
<h3></h3>
<h3>代码</h3>
<p><br class="spacer_" /></p>
<div class="codecolorer-container html4strict mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #00bbdd;">&lt;!DOCTYPE html&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/html.html"><span style="color: #000000; font-weight: bold;">html</span></a> manifest<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;tetris.manifest&quot;</span>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/head.html"><span style="color: #000000; font-weight: bold;">head</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/meta.html"><span style="color: #000000; font-weight: bold;">meta</span></a> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;viewport&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0&quot;</span><span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/meta.html"><span style="color: #000000; font-weight: bold;">meta</span></a> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;apple-mobile-web-app-capable&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;yes&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/meta.html"><span style="color: #000000; font-weight: bold;">meta</span></a> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;apple-mobile-web-app-status-bar-style&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;black&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/link.html"><span style="color: #000000; font-weight: bold;">link</span></a> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;apple-touch-icon&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;iphon_tetris_icon.png&quot;</span><span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/link.html"><span style="color: #000000; font-weight: bold;">link</span></a> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;apple-touch-startup-image&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;startup.png&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/link.html"><span style="color: #000000; font-weight: bold;">link</span></a> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;tetris.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">media</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;screen, mobile&quot;</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;main&quot;</span> <span style="color: #000066;">charset</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;utf-8&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/title.html"><span style="color: #000000; font-weight: bold;">title</span></a>&gt;</span>offline Tetris<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/title.html"><span style="color: #000000; font-weight: bold;">title</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/head.html"><span style="color: #000000; font-weight: bold;">head</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/body.html"><span style="color: #000000; font-weight: bold;">body</span></a>&gt;</span><br />
&nbsp; &nbsp;<span style="color: #808080; font-style: italic;">&lt;!-- Put your Markup Here --&gt;</span><br />
&nbsp; &nbsp;<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;tetris.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/body.html"><span style="color: #000000; font-weight: bold;">body</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/html.html"><span style="color: #000000; font-weight: bold;">html</span></a>&gt;</span></div></td></tr></tbody></table></div>
<p><html>中的 manifest=&#8221;cache.manifest&#8221; 属性将告诉浏览器我们可能需要对文件进行离线缓存。</p>
<p><br class="spacer_" /></p>
<p>下面是Apple专用的HTML 5属性：</p>
<ul>
<li>
<div class="codecolorer-container text mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">apple-mobile-web-app-capable</div></td></tr></tbody></table></div>
<p>: 设置为离线模式 </li>
<li>
<div class="codecolorer-container text mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">apple-mobile-web-app-status-bar-style</div></td></tr></tbody></table></div>
<p>: 当处于离线时隐藏状态条，导航条 </li>
<li>
<div class="codecolorer-container text mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">apple-touch-icon</div></td></tr></tbody></table></div>
<p>:指向作为图标的图像 </li>
<li>
<div class="codecolorer-container text mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">apple-touch-startup-image</div></td></tr></tbody></table></div>
<p>: 指向作为启动图像的url</li>
</ul>
<p><br class="spacer_" /></p>
<h3>CSS</h3>
<p><br class="spacer_" /></p>
<p>这几乎与普通网页完全一样。还有一些webkit专用的CSS能实现一些特殊效果如动画等。</p>
<p><br class="spacer_" /></p>
<p>我们使用的CSS如下：</p>
<pre>body {
    overflow:hidden;
    background: #d7d7d7;
    margin:0;
    padding:0;
}
#tetris {
    width: 320px;
    height: 460px;
    background:#000;
}</pre>
<h3>JavaScript</h3>
<p><br class="spacer_" /></p>
<p>我使用的是 <a href="http://www.daltonridenhour.com">Dalton Ridenhour</a> 的Javascript，源代码在 <a href="http://github.com/daltonridenhour/DOM-Tetris">Github</a>。原JS是为普通网页设计的，我们仅需要修改一下拿掉对键盘的支持。</p>
<p><br class="spacer_" /></p>
<p>通常JS在iPhone上完全能正常工作，当然有一些例外。请参阅 <a href="http://www.quirksmode.org/blog/archives/2008/08/iphone_events.html">events on the iPhone</a> 。</p>
<p><br class="spacer_" /></p>
<p>下面是完成的网页，你可以进行测试，看看它是怎样离线运行的：</p>
<p><br class="spacer_" /></p>
<p><a href="http://tetris.alexkessinger.net">http://tetris.alexkessinger.net</a></p>
<p><br class="spacer_" /></p>
<h3>设定图标和启动画面</h3>
<p><br class="spacer_" /></p>
<p>使用iPhone Safari浏览器，很容易将应用程序的图标添加到你iPhone上的Home Screen。</p>
<p><br class="spacer_" /></p>
<ul>
<li>首先，创建一个57&#215;57的png图标。将其放在网站的文档根目录下（注意不是服务器的文档根目录）</li>
</ul>
<p><br class="spacer_" /></p>
<p><a href="http://www.iphone-geek.cn/wp-content/uploads/2010/05/image5.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" src="http://www.iphone-geek.cn/wp-content/uploads/2010/05/image_thumb1.png" border="0" alt="image" width="61" height="61" /></a></p>
<p><br class="spacer_" /></p>
<ul>
<li>在html中加入（见上面HTML代码部分） ，指向图标文件。</li>
<li>在html中加入（见上面HTML代码部分） ，指向启动画面图像文件。</li>
<li>打开浏览器，在地址栏输入你Web App的URL，按下浏览器下方的加号，选择“Add To Home Screen”,然后输入Web App的名称，比如Tetris。</li>
</ul>
<p><br class="spacer_" /></p>
<p>这样一个积木游戏的图标就添加到了你的iPhone屏幕上，启动后即使你的iPhone没有在线，也可以正常运行。</p>
<p><br class="spacer_" /></p>
<h3>我的设想</h3>
<p><br class="spacer_" /></p>
<p>这样的Web App看上去与普通程序没什么大区别，不过却需要用户自己添加图标，这虽然不是什么大问题，但还不是很完美。我想要是在你的网页上添加一项“安装到iPhone/iPod Touch/iPad”，在按下后可以自动添加图标，那么一切就完美了。我现在还没有解决方法，大家有什么建议吗？</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iphone-geek.cn/%e7%bc%96%e7%a8%8b/%e5%88%9b%e5%bb%ba%e7%a6%bb%e7%ba%bfiphone-web-app/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>运行系统应用程序</title>
		<link>http://www.iphone-geek.cn/%e7%bc%96%e7%a8%8b/%e8%bf%90%e8%a1%8c%e7%b3%bb%e7%bb%9f%e5%ba%94%e7%94%a8%e7%a8%8b%e5%ba%8f</link>
		<comments>http://www.iphone-geek.cn/%e7%bc%96%e7%a8%8b/%e8%bf%90%e8%a1%8c%e7%b3%bb%e7%bb%9f%e5%ba%94%e7%94%a8%e7%a8%8b%e5%ba%8f#comments</comments>
		<pubDate>Sat, 21 Nov 2009 04:49:39 +0000</pubDate>
		<dc:creator>bagusflyer</dc:creator>
				<category><![CDATA[编程]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[sms]]></category>
		<category><![CDATA[拨号]]></category>
		<category><![CDATA[浏览器]]></category>
		<category><![CDATA[代码片段]]></category>

		<guid isPermaLink="false">http://www.iphone-geek.cn/?p=296</guid>
		<description><![CDATA[iPhone集成了许多应用程序，比如说浏览器，email，电话拨号等，但怎样在你的应用程序中调用这些程序呢？简单的方法是使用openURL。方法如下：
1. 打开网页：
12&#91;&#91;UIApplication sharedApplication&#93; 
&#160; &#160; openURL:&#91;NSURL URLWithString:@&#34;http://www.iphone-geek.cn&#34;&#93;&#93;;
2. 拨号：
12&#91;&#91;UIApplication sharedApplication&#93; 
&#160; &#160; openURL:&#91;NSURL URLWithString:@&#34;tel://13788102299&#34;&#93;&#93;;
3. SMS:
12&#91;&#91;UIApplication sharedApplication&#93; openURL:
&#160; &#160; &#91;NSURL URLWithString:@&#34;sms:13312345678&#34;&#93;&#93;;
4. Email:
123&#91;&#91;UIApplication sharedApplication&#93; 
&#160; &#160; openURL:&#91;NSURL URLWithString:
&#160; &#160; @&#34;mailto:emailAdress?subject=你好&#38;body=我的邮件&#34;&#93;&#93;;
]]></description>
			<content:encoded><![CDATA[<p>iPhone集成了许多应用程序，比如说浏览器，email，电话拨号等，但怎样在你的应用程序中调用这些程序呢？简单的方法是使用openURL。方法如下：</p>
<h2>1. 打开网页：</h2>
<div class="codecolorer-container objc mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIApplication sharedApplication<span style="color: #002200;">&#93;</span> <br />
&nbsp; &nbsp; openURL<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/"><span style="color: #400080;">NSURL</span></a> URLWithString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;http://www.iphone-geek.cn&quot;</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;</div></td></tr></tbody></table></div>
<h2>2. 拨号：</h2>
<div class="codecolorer-container objc mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIApplication sharedApplication<span style="color: #002200;">&#93;</span> <br />
&nbsp; &nbsp; openURL<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/"><span style="color: #400080;">NSURL</span></a> URLWithString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;tel://13788102299&quot;</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;</div></td></tr></tbody></table></div>
<h2>3. SMS:</h2>
<div class="codecolorer-container objc mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIApplication sharedApplication<span style="color: #002200;">&#93;</span> openURL<span style="color: #002200;">:</span><br />
&nbsp; &nbsp; <span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/"><span style="color: #400080;">NSURL</span></a> URLWithString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;sms:13312345678&quot;</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;</div></td></tr></tbody></table></div>
<h2>4. Email:</h2>
<div class="codecolorer-container objc mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIApplication sharedApplication<span style="color: #002200;">&#93;</span> <br />
&nbsp; &nbsp; openURL<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/"><span style="color: #400080;">NSURL</span></a> URLWithString<span style="color: #002200;">:</span><br />
&nbsp; &nbsp; <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;mailto:emailAdress?subject=你好&amp;body=我的邮件&quot;</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;</div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://www.iphone-geek.cn/%e7%bc%96%e7%a8%8b/%e8%bf%90%e8%a1%8c%e7%b3%bb%e7%bb%9f%e5%ba%94%e7%94%a8%e7%a8%8b%e5%ba%8f/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
