<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3644496878787142706</id><updated>2024-09-11T10:36:03.945-07:00</updated><category term="iPad develop"/><category term="iPad 應用"/><category term="iPhone develop"/><category term="iPhone4"/><category term="bookmark"/><category term="delegate"/><category term="iOS 4.2"/><category term="ipad 轉換影片"/><category term="iphone錄影品質"/><category term="join iOS develop program"/><category term="mac clean disk"/><category term="程式管理"/><category term="義信"/><category term="運算加速"/><title type='text'>iPhone/iPad develop</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://iphoneipad-develop.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://iphoneipad-develop.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Hsin</name><uri>http://www.blogger.com/profile/11673965008839019372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHCbYEown8QoYxImaBJ7gkp4LWmPJHgIS-DE4CfqN0brLrtJHnlue_XikYX52aobHVY_wr8QGlMgbG2myV_0DtZeHMbpJr7GpclQIeYYkdEi_xRmK001m5kf3gG57zxw/s220/1.sLByIvXvAHN'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>38</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3644496878787142706.post-5685229273955549702</id><published>2012-12-20T20:21:00.000-08:00</published><updated>2012-12-20T20:21:23.690-08:00</updated><title type='text'>google instant function</title><content type='html'>google instant&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Times New Roman&#39;, Times, FreeSerif, serif; font-size: 17.600000381469727px; line-height: 19.200000762939453px;&quot;&gt;Google工程師Matt Cutts也寫了一篇「&lt;/span&gt;&lt;a href=&quot;http://www.mattcutts.com/blog/thoughts-on-google-instant/&quot; style=&quot;background-color: white; color: #2288bb; font-family: &#39;Times New Roman&#39;, Times, FreeSerif, serif; font-size: 17.600000381469727px; line-height: 19.200000762939453px; text-decoration: initial;&quot; target=&quot;_blank&quot;&gt;Thoughts on Google Instant&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Times New Roman&#39;, Times, FreeSerif, serif; font-size: 17.600000381469727px; line-height: 19.200000762939453px;&quot;&gt;」，裡面很精闢的闡述了Google Instant的戰略意義&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Times New Roman&#39;, Times, FreeSerif, serif; font-size: 17.600000381469727px; line-height: 19.200000762939453px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Times New Roman&#39;, Times, FreeSerif, serif; font-size: 17.600000381469727px; line-height: 19.200000762939453px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Times New Roman&#39;, Times, FreeSerif, serif; font-size: 17.600000381469727px; line-height: 19.200000762939453px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Times New Roman&#39;, Times, FreeSerif, serif; font-size: 17.600000381469727px; line-height: 19.200000762939453px;&quot;&gt;gogole &amp;nbsp;insidesearch&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Times New Roman&#39;, Times, FreeSerif, serif; font-size: 17.600000381469727px; line-height: 19.200000762939453px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; font-size: 17.600000381469727px; line-height: 19.200000762939453px;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Times New Roman, Times, FreeSerif, serif;&quot;&gt;http://www.google.com/insidesearch/features/instant/about.html&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-size: 17.600000381469727px; line-height: 19.200000762939453px;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Times New Roman, Times, FreeSerif, serif;&quot;&gt;the follower article is from google page.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #444444; font-family: arial, sans-serif; font-size: 12.800000190734863px; line-height: 16px;&quot;&gt;Google 互動智慧搜尋是的搜尋強化功能，能隨著您輸入搜尋字詞的動作即時顯示搜尋結果。我們不斷追尋技術與基礎架構的極限，期待能更快速地提供您精確的搜尋結果。人的打字速度慢但閱讀速度快，所以我們依據這種特性研發了新的搜尋功能。一般來說，每次敲擊鍵盤需要 300 毫秒的時間，但只要只需要 30 毫秒就能一眼瞄過頁面上的另一個區域，兩者相差 10 倍的時間！這表示在您輸入關鍵字的同時，可以快速瀏覽頁面顯示的結果。&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://iphoneipad-develop.blogspot.com/feeds/5685229273955549702/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://iphoneipad-develop.blogspot.com/2012/12/google-instant-function.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/5685229273955549702'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/5685229273955549702'/><link rel='alternate' type='text/html' href='http://iphoneipad-develop.blogspot.com/2012/12/google-instant-function.html' title='google instant function'/><author><name>Hsin</name><uri>http://www.blogger.com/profile/11673965008839019372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHCbYEown8QoYxImaBJ7gkp4LWmPJHgIS-DE4CfqN0brLrtJHnlue_XikYX52aobHVY_wr8QGlMgbG2myV_0DtZeHMbpJr7GpclQIeYYkdEi_xRmK001m5kf3gG57zxw/s220/1.sLByIvXvAHN'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3644496878787142706.post-2870045662341605415</id><published>2012-01-16T17:17:00.000-08:00</published><updated>2012-01-16T17:17:19.232-08:00</updated><title type='text'>台南 iphone ipad ios 課程 研討會 交流會議</title><content type='html'>鑑於 台南 較少有 iphone 相關 研討交流會議&lt;br /&gt;
&lt;br /&gt;
想要找尋 一起 探討 iphone 開發的朋友，請到以下網址 報名&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://iosapp.weebly.com/&quot;&gt;http://iosapp.weebly.com/&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://iphoneipad-develop.blogspot.com/feeds/2870045662341605415/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://iphoneipad-develop.blogspot.com/2012/01/iphone-ipad-ios.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/2870045662341605415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/2870045662341605415'/><link rel='alternate' type='text/html' href='http://iphoneipad-develop.blogspot.com/2012/01/iphone-ipad-ios.html' title='台南 iphone ipad ios 課程 研討會 交流會議'/><author><name>Hsin</name><uri>http://www.blogger.com/profile/11673965008839019372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHCbYEown8QoYxImaBJ7gkp4LWmPJHgIS-DE4CfqN0brLrtJHnlue_XikYX52aobHVY_wr8QGlMgbG2myV_0DtZeHMbpJr7GpclQIeYYkdEi_xRmK001m5kf3gG57zxw/s220/1.sLByIvXvAHN'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3644496878787142706.post-3314726187798996344</id><published>2011-12-27T22:21:00.000-08:00</published><updated>2011-12-27T23:03:08.377-08:00</updated><title type='text'>UITableview load large data</title><content type='html'>&lt;h3 class=&quot;groups&quot; style=&quot;background-color: white; border-bottom-width: 0px; border-color: initial; border-image: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #333333; font-family: Arial, Helvetica, &#39;Nimbus Sans L&#39;, sans-serif; font-size: 16px; font-weight: inherit; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp;UiTableView Lazy Loading&lt;/h3&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;consider using iOS core data to store datas&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot;&gt;LazyTableImages sample code&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot;&gt;You want to arrange your code to grab all the data it needs before drawing&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot; /&gt;&lt;span style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot;&gt;the table, so the table can be scrolled comfortably. But that means you&#39;ve&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot; /&gt;&lt;span style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot;&gt;still got a delay.&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot;&gt;There are a few options.&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot; /&gt;&lt;span style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot;&gt;- You could disable the view, and put a spinner to show that it&#39;s loading,&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot; /&gt;&lt;span style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot;&gt;while you get the data. Once the data arrives, you could then display the&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot; /&gt;&lt;span style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot;&gt;view, including table.&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot; /&gt;&lt;span style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot;&gt;- If the table is only part of the view, you could display the table&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot; /&gt;&lt;span style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot;&gt;instantly, with 0 rows, so it&#39;s an empty table. The user can start clicking&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot; /&gt;&lt;span style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot;&gt;around at other things, while the data downloads, and once the data arrives&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot; /&gt;&lt;span style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot;&gt;you could then redraw the table appropriately.&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot; /&gt;&lt;span style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot;&gt;- Or you can just have the delay before things load, and let the app be a&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot; /&gt;&lt;span style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot;&gt;little non-responsive. Not ideal, but hey, it might be the easiest option to&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot; /&gt;&lt;span style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot;&gt;get your app built and released. Then you can worry about responsiveness&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot; /&gt;&lt;span style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot;&gt;later.&amp;nbsp;&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: arial, sans-serif; font-size: 12px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iphoneipad-develop.blogspot.com/feeds/3314726187798996344/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/12/uitableview-load-large-data.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/3314726187798996344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/3314726187798996344'/><link rel='alternate' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/12/uitableview-load-large-data.html' title='UITableview load large data'/><author><name>Hsin</name><uri>http://www.blogger.com/profile/11673965008839019372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHCbYEown8QoYxImaBJ7gkp4LWmPJHgIS-DE4CfqN0brLrtJHnlue_XikYX52aobHVY_wr8QGlMgbG2myV_0DtZeHMbpJr7GpclQIeYYkdEi_xRmK001m5kf3gG57zxw/s220/1.sLByIvXvAHN'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3644496878787142706.post-8501863297833750104</id><published>2011-11-22T16:35:00.001-08:00</published><updated>2011-11-22T16:35:10.654-08:00</updated><title type='text'>跨平台的行動應用程式開發框架</title><content type='html'>&lt;h3 class=&quot;post-title entry-title&quot; style=&quot;background-color: white; font: normal normal normal 24px/normal &#39;Trebuchet MS&#39;, Trebuchet, sans-serif; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0.75em; position: relative;&quot;&gt;PhoneGap 跨平台的行動應用程式開發框架&lt;/h3&gt;</content><link rel='replies' type='application/atom+xml' href='http://iphoneipad-develop.blogspot.com/feeds/8501863297833750104/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/11/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/8501863297833750104'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/8501863297833750104'/><link rel='alternate' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/11/blog-post.html' title='跨平台的行動應用程式開發框架'/><author><name>Hsin</name><uri>http://www.blogger.com/profile/11673965008839019372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHCbYEown8QoYxImaBJ7gkp4LWmPJHgIS-DE4CfqN0brLrtJHnlue_XikYX52aobHVY_wr8QGlMgbG2myV_0DtZeHMbpJr7GpclQIeYYkdEi_xRmK001m5kf3gG57zxw/s220/1.sLByIvXvAHN'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3644496878787142706.post-2892487103466448643</id><published>2011-11-21T23:38:00.001-08:00</published><updated>2011-11-21T23:38:43.910-08:00</updated><title type='text'>iphone write image to 照片集</title><content type='html'>&lt;pre class=&quot;lang-c prettyprint&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 18px; margin-bottom: 10px; max-height: 600px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; text-align: left; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;typ&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;write image to 照片集&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;lang-c prettyprint&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 18px; margin-bottom: 10px; max-height: 600px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; text-align: left; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;typ&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;lang-c prettyprint&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 18px; margin-bottom: 10px; max-height: 600px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; text-align: left; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;typ&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;ALAssetsLibrary&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;library &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;[[&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;ALAssetsLibrary&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt; alloc&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt; init&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;];&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;

&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;library writeImageToSavedPhotosAlbum&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;:[&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;image &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;CGImage&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt; orientation&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;:(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;ALAssetOrientation&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;)[&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;image imageOrientation&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt; completionBlock&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;:^(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;NSURL &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;assetURL&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;NSError&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;){&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: darkblue; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;// TODO: error handling&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: darkblue; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: grey; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;// TODO: success handling&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;}];&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;library release&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;];&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://iphoneipad-develop.blogspot.com/feeds/2892487103466448643/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/11/iphone-write-image-to.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/2892487103466448643'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/2892487103466448643'/><link rel='alternate' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/11/iphone-write-image-to.html' title='iphone write image to 照片集'/><author><name>Hsin</name><uri>http://www.blogger.com/profile/11673965008839019372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHCbYEown8QoYxImaBJ7gkp4LWmPJHgIS-DE4CfqN0brLrtJHnlue_XikYX52aobHVY_wr8QGlMgbG2myV_0DtZeHMbpJr7GpclQIeYYkdEi_xRmK001m5kf3gG57zxw/s220/1.sLByIvXvAHN'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3644496878787142706.post-7599595380552368074</id><published>2011-09-17T10:25:00.000-07:00</published><updated>2011-09-17T10:25:43.346-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iphone錄影品質"/><title type='text'>控制 iphone錄影 品質</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: &#39;Lucida Grande&#39;, Geneva, Helvetica, Arial, sans-serif; font-size: 13px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;dt style=&quot;clear: both; margin-top: 0px;&quot;&gt;&lt;code class=&quot;jump constantName&quot; style=&quot;color: #666666; font-family: Courier, Consolas, monospace; font-size: 13px;&quot;&gt;&lt;br /&gt;
&lt;/code&gt;&lt;/dt&gt;&lt;br /&gt;
&lt;dt style=&quot;clear: both; margin-top: 0px;&quot;&gt;&lt;code class=&quot;jump constantName&quot; style=&quot;color: #666666; font-family: Courier, Consolas, monospace; font-size: 13px;&quot;&gt;&lt;br /&gt;
&lt;/code&gt;&lt;/dt&gt;&lt;br /&gt;
&lt;dt style=&quot;clear: both; margin-top: 0px;&quot;&gt;&lt;code class=&quot;jump constantName&quot; style=&quot;color: #666666; font-family: Courier, Consolas, monospace; font-size: 13px;&quot;&gt;在AVCaptureSession &amp;nbsp;Class裡面， 可以sessionPreset進行設定 改變錄影品質&lt;/code&gt;&lt;/dt&gt;&lt;br /&gt;
&lt;dt style=&quot;clear: both; margin-top: 0px;&quot;&gt;&lt;code class=&quot;jump constantName&quot; style=&quot;color: #666666; font-family: Courier, Consolas, monospace; font-size: 13px;&quot;&gt;&lt;br /&gt;
&lt;/code&gt;&lt;/dt&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: &#39;Lucida Grande&#39;, Geneva, Helvetica, Arial, sans-serif; font-size: 13px;&quot;&gt;&lt;div class=&quot;api propertyObjC&quot;&gt;&lt;h3 class=&quot;jump propertyObjC method_property&quot; id=&quot;jumpTo_7&quot; style=&quot;color: black; font-size: 19px; margin-bottom: 0.25em; margin-top: 1.5em;&quot;&gt;sessionPreset&lt;/h3&gt;&lt;div class=&quot;abstract&quot; style=&quot;font: normal normal normal 100%/normal &#39;Lucida Grande&#39;, Geneva, Helvetica, Arial, sans-serif; margin-bottom: 0.833em; margin-top: 1.083em;&quot;&gt;A constant value indicating the quality level or bitrate of the output.&lt;/div&gt;&lt;div class=&quot;declaration&quot; style=&quot;font: normal normal normal 102%/normal Courier, Consolas, monospace; margin-bottom: 0.909em; margin-top: 1.182em;&quot;&gt;&lt;div class=&quot;declaration&quot; style=&quot;font: normal normal normal 102%/normal Courier, Consolas, monospace; margin-bottom: 0.909em; margin-top: 1.182em;&quot;&gt;@property(nonatomic, copy)&amp;nbsp;&lt;a href=&quot;http://developer.apple.com/library/ios/DOCUMENTATION/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html#//apple_ref/doc/c_ref/NSString&quot; style=&quot;color: #3366cc; text-decoration: none;&quot;&gt;NSString&lt;/a&gt;&amp;nbsp;*sessionPreset&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;api discussion&quot;&gt;&lt;h5 style=&quot;color: black; font-size: 13px; margin-bottom: 0.154em; margin-left: 0px; margin-right: 0px; margin-top: 0.692em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Discussion&lt;/h5&gt;&lt;div style=&quot;font: normal normal normal 100%/normal &#39;Lucida Grande&#39;, Geneva, Helvetica, Arial, sans-serif; margin-bottom: 0.833em;&quot;&gt;You use this property to customize the quality level or bitrate of the output. For possible values of&lt;em style=&quot;font-family: &#39;Lucida Grande&#39;, Geneva, Helvetica, Arial, sans-serif; font-size: 13px; font-style: italic;&quot;&gt;sessionPreset&lt;/em&gt;, see&amp;nbsp;&lt;span class=&quot;content_text&quot; style=&quot;font: normal normal normal 100%/normal &#39;Lucida Grande&#39;, Geneva, Helvetica, Arial, sans-serif; margin-bottom: 0.833em; margin-top: 0px; padding-bottom: 0.833em; vertical-align: top;&quot;&gt;&lt;a href=&quot;http://developer.apple.com/library/ios/DOCUMENTATION/AVFoundation/Reference/AVCaptureSession_Class/Reference/Reference.html#//apple_ref/doc/constant_group/Video_Input_Presets&quot; style=&quot;color: #3366cc; text-decoration: none;&quot;&gt;“Video Input Presets.”&lt;/a&gt;&lt;/span&gt;&amp;nbsp;The default value is&amp;nbsp;&lt;code style=&quot;color: #666666; font-family: Courier, Consolas, monospace; font-size: 13px;&quot;&gt;&lt;a href=&quot;http://developer.apple.com/library/ios/DOCUMENTATION/AVFoundation/Reference/AVCaptureSession_Class/Reference/Reference.html#//apple_ref/c/data/AVCaptureSessionPresetHigh&quot; style=&quot;color: #3366cc; text-decoration: none;&quot;&gt;AVCaptureSessionPresetHigh&lt;/a&gt;&lt;/code&gt;.&lt;/div&gt;&lt;div style=&quot;font: normal normal normal 100%/normal &#39;Lucida Grande&#39;, Geneva, Helvetica, Arial, sans-serif; margin-bottom: 0.833em;&quot;&gt;You can set this value while the session is running.&lt;/div&gt;&lt;div style=&quot;font: normal normal normal 100%/normal &#39;Lucida Grande&#39;, Geneva, Helvetica, Arial, sans-serif; margin-bottom: 0.833em;&quot;&gt;You can only set a preset if&amp;nbsp;&lt;code style=&quot;color: #666666; font-family: Courier, Consolas, monospace; font-size: 13px;&quot;&gt;&lt;a href=&quot;http://developer.apple.com/library/ios/DOCUMENTATION/AVFoundation/Reference/AVCaptureSession_Class/Reference/Reference.html#//apple_ref/occ/instm/AVCaptureSession/canSetSessionPreset:&quot; style=&quot;color: #3366cc; text-decoration: none;&quot;&gt;canSetSessionPreset:&lt;/a&gt;&lt;/code&gt;&amp;nbsp;returns&amp;nbsp;&lt;code style=&quot;color: #666666; font-family: Courier, Consolas, monospace; font-size: 13px;&quot;&gt;YES&lt;/code&gt;&amp;nbsp;for that preset.&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;api availability&quot;&gt;&lt;h5 style=&quot;color: black; font-size: 13px; margin-bottom: 0.154em; margin-left: 0px; margin-right: 0px; margin-top: 0.692em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Availability&lt;/h5&gt;&lt;ul style=&quot;list-style-image: initial; list-style-position: outside; list-style-type: none; margin-bottom: -0.909em; margin-left: 0.25em; margin-right: 0px; margin-top: 0px; padding-bottom: 0.5em; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0px; margin-left: -3px; margin-right: 0px; margin-top: 0.182em;&quot;&gt;Available in iOS 4.0 and later.&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;div class=&quot;api declaredIn&quot;&gt;&lt;h5 style=&quot;color: black; font-size: 13px; margin-bottom: 0.154em; margin-left: 0px; margin-right: 0px; margin-top: 0.692em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Declared In&lt;/h5&gt;&lt;code class=&quot;HeaderFile&quot; style=&quot;color: #666666; font-family: Courier, Consolas, monospace; font-size: 13px;&quot;&gt;AVCaptureSession.h&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;zInstanceMethods&quot; id=&quot;InstanceMethods_section&quot;&gt;&lt;a href=&quot;&quot; name=&quot;//apple_ref/doc/uid/TP40009521-CH1-DontLinkElementID_6&quot; style=&quot;color: #3366cc; text-decoration: none;&quot; title=&quot;Instance Methods&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: &#39;Lucida Grande&#39;, Geneva, Helvetica, Arial, sans-serif; font-size: 13px;&quot;&gt;&lt;br /&gt;
&lt;dt style=&quot;clear: both; margin-top: 0px;&quot;&gt;&lt;code class=&quot;jump constantName&quot; style=&quot;color: #666666; font-family: Courier, Consolas, monospace; font-size: 13px;&quot;&gt;&lt;br /&gt;
&lt;/code&gt;&lt;/dt&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #666666; font-family: Courier, Consolas, monospace; font-size: x-small;&quot;&gt;http://developer.apple.com/library/ios/#DOCUMENTATION/AVFoundation/Reference/AVCaptureSession_Class/Reference/Reference.html#//apple_ref/doc/c_ref/AVCaptureSessionPreset640x480&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Lucida Grande&#39;, Geneva, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 19px;&quot;&gt;&lt;b&gt;Video Input Presets&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: &#39;Lucida Grande&#39;, Geneva, Helvetica, Arial, sans-serif; font-size: 13px;&quot;&gt;&lt;div class=&quot;abstract&quot; style=&quot;font: normal normal normal 100%/normal &#39;Lucida Grande&#39;, Geneva, Helvetica, Arial, sans-serif; margin-bottom: 0.833em; margin-top: 1.083em;&quot;&gt;Constants to define capture setting presets using the&amp;nbsp;&lt;code style=&quot;color: #666666; font-family: Courier, Consolas, monospace; font-size: 13px;&quot;&gt;&lt;a href=&quot;http://developer.apple.com/library/ios/DOCUMENTATION/AVFoundation/Reference/AVCaptureSession_Class/Reference/Reference.html#//apple_ref/occ/instp/AVCaptureSession/sessionPreset&quot; style=&quot;color: #3366cc; text-decoration: none;&quot;&gt;sessionPreset&lt;/a&gt;&lt;/code&gt;&amp;nbsp;property.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: &#39;Lucida Grande&#39;, Geneva, Helvetica, Arial, sans-serif; font-size: 13px;&quot;&gt;&lt;br /&gt;
&lt;dt style=&quot;clear: both; margin-top: 0px;&quot;&gt;&lt;code class=&quot;jump constantName&quot; style=&quot;color: #666666; font-family: Courier, Consolas, monospace; font-size: 13px;&quot;&gt;&lt;br /&gt;
&lt;/code&gt;&lt;/dt&gt;&lt;br /&gt;
&lt;dt style=&quot;clear: both; margin-top: 0px;&quot;&gt;&lt;code class=&quot;jump constantName&quot; id=&quot;jumpTo_29&quot; style=&quot;color: #666666; font-family: Courier, Consolas, monospace; font-size: 13px;&quot;&gt;AVCaptureSessionPresetLow&lt;/code&gt;&lt;/dt&gt;&lt;br /&gt;
&lt;dd style=&quot;margin-bottom: 0.5em; margin-left: 1.25em; margin-top: 0.083em;&quot;&gt;&lt;div style=&quot;font: normal normal normal 100%/normal &#39;Lucida Grande&#39;, Geneva, Helvetica, Arial, sans-serif; margin-bottom: 0.5em; margin-top: -0.083em;&quot;&gt;Specifies capture settings suitable for output video and audio bitrates suitable for sharing over 3G.&lt;/div&gt;&lt;div style=&quot;font: normal normal normal 100%/normal &#39;Lucida Grande&#39;, Geneva, Helvetica, Arial, sans-serif; margin-bottom: 0.5em; margin-top: -0.083em;&quot;&gt;Available in iOS 4.0 and later.&lt;/div&gt;&lt;div style=&quot;font: normal normal normal 100%/normal &#39;Lucida Grande&#39;, Geneva, Helvetica, Arial, sans-serif; margin-bottom: 0.5em; margin-top: -0.083em;&quot;&gt;Declared in&amp;nbsp;&lt;code style=&quot;color: #666666; font-family: Courier, Consolas, monospace; font-size: 13px;&quot;&gt;AVCaptureSession.h&lt;/code&gt;.&lt;/div&gt;&lt;/dd&gt;&lt;a href=&quot;&quot; name=&quot;//apple_ref/c/data/AVCaptureSessionPreset640x480&quot; style=&quot;color: #3366cc; text-decoration: none;&quot; title=&quot;AVCaptureSessionPreset640x480&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;//apple_ref/doc/c_ref/AVCaptureSessionPreset640x480&quot; style=&quot;color: #3366cc; text-decoration: none;&quot; title=&quot;AVCaptureSessionPreset640x480&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;//apple_ref/doc/uid/TP40009521-CH1-SW48&quot; style=&quot;color: #3366cc; text-decoration: none;&quot; title=&quot;AVCaptureSessionPreset640x480&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;//apple_ref/doc/uid/TP40009521-CH1-DontLinkElementID_42&quot; style=&quot;color: #3366cc; text-decoration: none;&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;dt style=&quot;clear: both; margin-top: 0px;&quot;&gt;&lt;code class=&quot;jump constantName&quot; id=&quot;jumpTo_30&quot; style=&quot;color: #666666; font-family: Courier, Consolas, monospace; font-size: 13px;&quot;&gt;AVCaptureSessionPreset640x480&lt;/code&gt;&lt;/dt&gt;&lt;br /&gt;
&lt;dd style=&quot;margin-bottom: 0.5em; margin-left: 1.25em; margin-top: 0.083em;&quot;&gt;&lt;div style=&quot;font: normal normal normal 100%/normal &#39;Lucida Grande&#39;, Geneva, Helvetica, Arial, sans-serif; margin-bottom: 0.5em; margin-top: -0.083em;&quot;&gt;Specifies capture settings suitable for VGA quality (640x480 pixel) video output.&lt;/div&gt;&lt;div style=&quot;font: normal normal normal 100%/normal &#39;Lucida Grande&#39;, Geneva, Helvetica, Arial, sans-serif; margin-bottom: 0.5em; margin-top: -0.083em;&quot;&gt;Available in iOS 4.0 and later.&lt;/div&gt;&lt;div style=&quot;font: normal normal normal 100%/normal &#39;Lucida Grande&#39;, Geneva, Helvetica, Arial, sans-serif; margin-bottom: 0.5em; margin-top: -0.083em;&quot;&gt;Declared in&amp;nbsp;&lt;code style=&quot;color: #666666; font-family: Courier, Consolas, monospace; font-size: 13px;&quot;&gt;AVCaptureSession.h&lt;/code&gt;.&lt;/div&gt;&lt;/dd&gt;&lt;a href=&quot;&quot; name=&quot;//apple_ref/c/data/AVCaptureSessionPreset1280x720&quot; style=&quot;color: #3366cc; text-decoration: none;&quot; title=&quot;AVCaptureSessionPreset1280x720&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;//apple_ref/doc/c_ref/AVCaptureSessionPreset1280x720&quot; style=&quot;color: #3366cc; text-decoration: none;&quot; title=&quot;AVCaptureSessionPreset1280x720&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;//apple_ref/doc/uid/TP40009521-CH1-SW35&quot; style=&quot;color: #3366cc; text-decoration: none;&quot; title=&quot;AVCaptureSessionPreset1280x720&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;//apple_ref/doc/uid/TP40009521-CH1-DontLinkElementID_44&quot; style=&quot;color: #3366cc; text-decoration: none;&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;dt style=&quot;clear: both; margin-top: 0px;&quot;&gt;&lt;code class=&quot;jump constantName&quot; id=&quot;jumpTo_31&quot; style=&quot;color: #666666; font-family: Courier, Consolas, monospace; font-size: 13px;&quot;&gt;AVCaptureSessionPreset1280x720&lt;/code&gt;&lt;/dt&gt;&lt;br /&gt;
&lt;dd style=&quot;margin-bottom: 0.5em; margin-left: 1.25em; margin-top: 0.083em;&quot;&gt;&lt;div style=&quot;font: normal normal normal 100%/normal &#39;Lucida Grande&#39;, Geneva, Helvetica, Arial, sans-serif; margin-bottom: 0.5em; margin-top: -0.083em;&quot;&gt;Specifies capture settings suitable for 720p quality (1280x720pixel) video output.&lt;/div&gt;&lt;div style=&quot;font: normal normal normal 100%/normal &#39;Lucida Grande&#39;, Geneva, Helvetica, Arial, sans-serif; margin-bottom: 0.5em; margin-top: -0.083em;&quot;&gt;Available in iOS 4.0 and later.&lt;/div&gt;&lt;div style=&quot;font: normal normal normal 100%/normal &#39;Lucida Grande&#39;, Geneva, Helvetica, Arial, sans-serif; margin-bottom: 0.5em; margin-top: -0.083em;&quot;&gt;Declared in&amp;nbsp;&lt;code style=&quot;color: #666666; font-family: Courier, Consolas, monospace; font-size: 13px;&quot;&gt;AVCaptureSession.h&lt;/code&gt;.&lt;/div&gt;&lt;/dd&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://iphoneipad-develop.blogspot.com/feeds/7599595380552368074/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/09/iphone.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/7599595380552368074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/7599595380552368074'/><link rel='alternate' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/09/iphone.html' title='控制 iphone錄影 品質'/><author><name>Hsin</name><uri>http://www.blogger.com/profile/11673965008839019372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHCbYEown8QoYxImaBJ7gkp4LWmPJHgIS-DE4CfqN0brLrtJHnlue_XikYX52aobHVY_wr8QGlMgbG2myV_0DtZeHMbpJr7GpclQIeYYkdEi_xRmK001m5kf3gG57zxw/s220/1.sLByIvXvAHN'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3644496878787142706.post-308609750127983391</id><published>2011-09-17T10:02:00.000-07:00</published><updated>2011-09-17T10:02:27.654-07:00</updated><title type='text'>如何將 舊有 專案 加入 git version control ？</title><content type='html'>在新增專案時，可以直接用選取的方式，將專案放入git 版本控管。&lt;br /&gt;
&lt;br /&gt;
但如果 是在已經舊有的專案中，如何 將專案放進 git 版本控管呢？&lt;br /&gt;
&lt;br /&gt;
可直接以terminal&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: &#39;Lucida Grande&#39;, Geneva, Helvetica, Arial, sans-serif; font-size: 13px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;inlinerecipe-name task-name&quot; style=&quot;color: #666666; cursor: pointer; font-weight: bold; margin-bottom: 0.45em; margin-top: 0.75em; padding-bottom: 2px; padding-top: 3px; position: relative; text-decoration: none;&quot;&gt;&lt;div style=&quot;margin-left: 23px;&quot;&gt;&lt;a href=&quot;&quot; style=&quot;color: #666666; text-decoration: none;&quot; target=&quot;_self&quot;&gt;To set up a Git repository from the command line . . .&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;inlinerecipe-content task-content&quot; data-source-url=&quot;../../../../../recipes/xcode_help-repositories_organizer/SettingupaGitRepositoryfromtheCommandLine/&quot; id=&quot;&quot; style=&quot;margin-left: 22px; overflow-x: hidden; overflow-y: hidden; padding-top: 7px;&quot;&gt;&lt;a href=&quot;&quot; name=&quot;//apple_ref/doc/uid/TP40010350-CH2&quot; style=&quot;color: #3366cc; text-decoration: none;&quot; title=&quot;Setting Up a Git Repository from the Command Line&quot;&gt;&lt;/a&gt;&lt;article class=&quot;has-steps&quot; id=&quot;pediaContents&quot; role=&quot;main&quot;&gt;&lt;a href=&quot;&quot; name=&quot;//apple_ref/doc/uid/TP40010350-CH2-SW1&quot; style=&quot;color: #3366cc; text-decoration: none;&quot; title=&quot;Setting Up a Git Repository from the Command Line&quot;&gt;&lt;/a&gt;&lt;div id=&quot;leftside&quot;&gt;&lt;ol class=&quot;recipeSteps&quot; style=&quot;list-style-position: outside; list-style-type: decimal; margin-bottom: 0.866em; margin-left: 1.75em; margin-right: 0px; margin-top: 0px; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li class=&quot;li&quot; style=&quot;margin-top: 0.583em;&quot;&gt;&lt;div style=&quot;display: inline; font: normal normal normal 100%/normal &#39;Lucida Grande&#39;, Geneva, Helvetica, Arial, sans-serif; margin-bottom: 0.833em; margin-top: 0.667em;&quot;&gt;Use the&amp;nbsp;&lt;code style=&quot;color: #666666; font-family: Courier, Consolas, monospace; font-size: 13px;&quot;&gt;cd&lt;/code&gt;&amp;nbsp;command to switch to your project folder, making it the current working directory.&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li&quot; style=&quot;margin-top: 0.583em;&quot;&gt;&lt;div style=&quot;display: inline; font: normal normal normal 100%/normal &#39;Lucida Grande&#39;, Geneva, Helvetica, Arial, sans-serif; margin-bottom: 0.833em; margin-top: 0.667em;&quot;&gt;Enter&amp;nbsp;&lt;code style=&quot;color: #666666; font-family: Courier, Consolas, monospace; font-size: 13px;&quot;&gt;git init&lt;/code&gt;&amp;nbsp;to create an empty repository.&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li&quot; style=&quot;margin-top: 0.583em;&quot;&gt;&lt;div style=&quot;display: inline; font: normal normal normal 100%/normal &#39;Lucida Grande&#39;, Geneva, Helvetica, Arial, sans-serif; margin-bottom: 0.833em; margin-top: 0.667em;&quot;&gt;Enter&amp;nbsp;&lt;code style=&quot;color: #666666; font-family: Courier, Consolas, monospace; font-size: 13px;&quot;&gt;git add .&lt;/code&gt;&amp;nbsp;to copy your project files into the repository.&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li&quot; style=&quot;margin-top: 0.583em;&quot;&gt;&lt;div style=&quot;display: inline; font: normal normal normal 100%/normal &#39;Lucida Grande&#39;, Geneva, Helvetica, Arial, sans-serif; margin-bottom: 0.833em; margin-top: 0.667em;&quot;&gt;Enter&amp;nbsp;&lt;code style=&quot;color: #666666; font-family: Courier, Consolas, monospace; font-size: 13px;&quot;&gt;git commit -m &quot;Initial commit.&quot;&lt;/code&gt;&amp;nbsp;to commit all the files.&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/article&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iphoneipad-develop.blogspot.com/feeds/308609750127983391/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/09/git-version-control.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/308609750127983391'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/308609750127983391'/><link rel='alternate' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/09/git-version-control.html' title='如何將 舊有 專案 加入 git version control ？'/><author><name>Hsin</name><uri>http://www.blogger.com/profile/11673965008839019372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHCbYEown8QoYxImaBJ7gkp4LWmPJHgIS-DE4CfqN0brLrtJHnlue_XikYX52aobHVY_wr8QGlMgbG2myV_0DtZeHMbpJr7GpclQIeYYkdEi_xRmK001m5kf3gG57zxw/s220/1.sLByIvXvAHN'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3644496878787142706.post-9030080858982945131</id><published>2011-06-29T19:38:00.001-07:00</published><updated>2011-06-29T19:38:48.820-07:00</updated><title type='text'>透過Xcode直接把應用程式打包成ipa</title><content type='html'>&lt;div class=&quot;post-headline&quot; style=&quot;font-family: tahoma, arial, sans-serif; font-size: 13px;&quot;&gt;&lt;h1 id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot; style=&quot;font-size: 34px; line-height: 1.2; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;[iPhone開發]透過Xcode直接把應用程式打包成ipa&lt;/h1&gt;&lt;/div&gt;&lt;div class=&quot;post-bodycopy clearfix&quot; style=&quot;display: block; font-family: tahoma, arial, sans-serif; font-size: 13px; min-width: 0px;&quot;&gt;&lt;div style=&quot;display: block; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;color: red;&quot;&gt;注意：本方法需要先製作假憑證編譯於專案中，否則產生的ipa還是無法於iPhone中運行。製作方法請參考&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div style=&quot;display: block; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;a href=&quot;http://blog.lansea-chu.com/index.php/archives/786&quot; style=&quot;color: #666666; font-weight: bold; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;&lt;span style=&quot;color: red;&quot;&gt;http://blog.lansea-chu.com/index.php/archives/786&lt;/span&gt;&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;display: block; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;由於我有測試應用程式的需求,&lt;/div&gt;&lt;div style=&quot;display: block; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;採用ipa的方式佈署對我來說最快速也最方便。&lt;/div&gt;&lt;div style=&quot;display: block; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;也不需要另外透過SSH等方式來做佈署,&lt;br /&gt;
產生ipa檔的方式其實很容易,&lt;/div&gt;&lt;div style=&quot;display: block; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;沒有甚麼必要另外安裝外掛或者是用一些特殊方式&lt;/div&gt;&lt;div style=&quot;display: block; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;只要在編譯的時候選擇編譯到『裝置』&lt;/div&gt;&lt;div style=&quot;display: block; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;(即使你iPhone沒接上也沒關係)&lt;/div&gt;&lt;div style=&quot;display: block; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;編譯後如果說無法於裝置上執行,不用管他&lt;/div&gt;&lt;div style=&quot;display: block; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;直接編譯後到build資料夾底下去找編譯好的檔案,&lt;/div&gt;&lt;div style=&quot;display: block; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;有一個資料夾內會有兩個檔案&lt;br /&gt;
分別為你的專案名稱,與*.dSYM&lt;br /&gt;
在這個資料夾下創立一個目錄名字為Payload(大小寫要注意,否則會安裝失敗)&lt;/div&gt;&lt;div style=&quot;display: block; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;我們只需要將你的專案名稱的那個檔案,&lt;/div&gt;&lt;div style=&quot;display: block; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;放入這個目錄&lt;/div&gt;&lt;div style=&quot;display: block; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;接著壓縮成zip檔案,&lt;/div&gt;&lt;div style=&quot;display: block; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;再把副檔名改為.ipa&lt;/div&gt;&lt;div id=&quot;&quot; style=&quot;display: block; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;即可透過iTunes把ipa佈署到iPhone了&lt;/div&gt;&lt;div id=&quot;&quot; style=&quot;display: block; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div id=&quot;&quot; style=&quot;display: block; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;資源來源&amp;nbsp;&lt;a href=&quot;http://blog.lansea-chu.com/index.php/archives/746&quot;&gt;http://blog.lansea-chu.com/index.php/archives/746&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iphoneipad-develop.blogspot.com/feeds/9030080858982945131/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/06/xcodeipa.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/9030080858982945131'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/9030080858982945131'/><link rel='alternate' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/06/xcodeipa.html' title='透過Xcode直接把應用程式打包成ipa'/><author><name>Hsin</name><uri>http://www.blogger.com/profile/11673965008839019372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHCbYEown8QoYxImaBJ7gkp4LWmPJHgIS-DE4CfqN0brLrtJHnlue_XikYX52aobHVY_wr8QGlMgbG2myV_0DtZeHMbpJr7GpclQIeYYkdEi_xRmK001m5kf3gG57zxw/s220/1.sLByIvXvAHN'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3644496878787142706.post-8562313413847507794</id><published>2011-05-29T19:48:00.000-07:00</published><updated>2011-05-29T19:48:08.213-07:00</updated><title type='text'>網站安全性測試</title><content type='html'>&lt;h3 class=&quot;post-title entry-title&quot; id=&quot;&quot; style=&quot;color: #555544; font-family: tahoma, &#39;Trebuchet MS&#39;, lucida, helvetica, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 5px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;a href=&quot;http://www.mail-archive.com/php-general@lists.php.net/msg160883.html&quot;&gt;http://www.mail-archive.com/php-general@lists.php.net/msg160883.html&lt;/a&gt;&lt;/h3&gt;&lt;div&gt;PHP read /write&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;pre id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot;&gt;you can even bury it *inside* a directory that the PHP user can *NOT*
read, so the Bad Guy has to &quot;guess&quot; at the name of the directory that they
can read, because it&#39;s inside a directory that they can&#39;t read:

mkdir access
chmod 600 access
mkdir access/images
chmod 700 access/images
chown apache access/images

So now the &#39;apache&#39; user (may be &#39;nobody&#39; or &#39;www&#39; or ... on your system)
can do what it wants with the images directory, but somebody poking around
in your system won&#39;t *KNOW* there is an images directory, cuz they can&#39;t
read &#39;access&#39; directory to find out it&#39;s there.&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;h3 class=&quot;post-title entry-title&quot; id=&quot;&quot; style=&quot;color: #555544; font-family: tahoma, &#39;Trebuchet MS&#39;, lucida, helvetica, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 5px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/h3&gt;&lt;h3 class=&quot;post-title entry-title&quot; id=&quot;&quot; style=&quot;color: #555544; font-family: tahoma, &#39;Trebuchet MS&#39;, lucida, helvetica, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 5px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;a href=&quot;http://myblog-johnnyit.blogspot.com/2008/07/website-security.html&quot;&gt;http://myblog-johnnyit.blogspot.com/2008/07/website-security.html&lt;/a&gt;&lt;/h3&gt;&lt;h3 class=&quot;post-title entry-title&quot; id=&quot;&quot; style=&quot;color: #555544; font-family: tahoma, &#39;Trebuchet MS&#39;, lucida, helvetica, sans-serif; font-size: 16px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 5px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;WebSite Security網站安全性測試軟體&lt;/h3&gt;&lt;div class=&quot;post-header&quot; style=&quot;color: #555544; font-family: tahoma, &#39;Trebuchet MS&#39;, lucida, helvetica, sans-serif; font-size: 13px;&quot;&gt;&lt;div class=&quot;post-header-line-1&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;post-body entry-content&quot; id=&quot;post-body-5836671649953267247&quot; style=&quot;color: #555544; font-family: tahoma, &#39;Trebuchet MS&#39;, lucida, helvetica, sans-serif; font-size: 13px; line-height: 18px; margin-bottom: 1em; margin-top: 5px;&quot;&gt;使用下面軟體測試網站時，&lt;span style=&quot;color: red;&quot;&gt;請先以備援網站測試&lt;/span&gt;，以策安全&lt;br /&gt;
&lt;a href=&quot;http://code.google.com/p/ratproxy/&quot; id=&quot;&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #669922; font-weight: bold; text-decoration: none;&quot;&gt;RatProxy&lt;/a&gt;為Google提供之網站安全性檢測工具&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.google.com.tw/search?q=websecurify+%22googlecode%22&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #669922; font-weight: bold; text-decoration: none;&quot;&gt;WebSecurity&lt;/a&gt;,提供Web安全性檢查評估報告(如:XSS ,CSRF等)工具,&lt;br /&gt;
安裝新版本後,執行出現&quot;無法找到程序輸入點&quot;,Couldn&#39;t load XPCOM,原因是舊的版本並未移除,故移除重裝後即可正常執行&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(開放源碼)&lt;a href=&quot;http://www.google.com.tw/search?q=Web+application+vulnerability+scanner+Wapiti&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #669922; font-weight: bold; text-decoration: none;&quot;&gt;Web application vulnerability scanner(Wapiti)&lt;/a&gt;&lt;br /&gt;
使用方式需搭配Python指令一起使用,即 python wapiti.py http://www.example.com.tw/base/url/&lt;br /&gt;
&lt;br /&gt;
(開放源碼)&lt;a href=&quot;http://www.google.com.tw/search?q=Category%3AOWASP+WebScarab+Project&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #669922; font-weight: bold; text-decoration: none;&quot;&gt;WebScarab&lt;/a&gt;是OWASP提供分析http與https協定之安全性檢查軟體,支援Linux,Windows,Mac等作業系統&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.acunetix.com/cross-site-scripting/Copy-scanner.htm&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #669922; font-weight: bold; text-decoration: none;&quot;&gt;Acunetix&amp;nbsp;&lt;/a&gt;Cross Site Scripting(XSS) Vulnerabilities Scanner (偵測XSS漏洞工具),&lt;br /&gt;
XSS相關參考工具:&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;a href=&quot;http://www.google.com.tw/search?q=+Anti-Cross+Site+Scripting+Library+site%3Amicrosoft.com&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #669922; font-weight: bold; text-decoration: none;&quot;&gt;微軟Anti-Cross Site Scripting Library&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.google.com.tw/search?q=XSS+Detect+Beta+Code+Analysis+Tool+site%3Amicrosoft.com&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #669922; font-weight: bold; text-decoration: none;&quot;&gt;微軟XSS Detect Beta Code Analysis Tool&lt;/a&gt;,需搭配Visual Studio 2005一起才能使用&lt;br /&gt;
&lt;a href=&quot;http://www.google.com.tw/search?q=x5s+xss+%22codeplex%22+testing+assistant&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #669922; font-weight: bold; text-decoration: none;&quot;&gt;x5s&lt;/a&gt;,搭配&lt;a href=&quot;http://myblog-johnnyit.blogspot.com/2008/05/yslow.html&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #669922; font-weight: bold; text-decoration: none;&quot;&gt;Fiddle&lt;/a&gt;r Add-on使用&lt;br /&gt;
&lt;br /&gt;
(開放源碼)&lt;a href=&quot;http://www.google.com.tw/search?q=OWASP_Pantera_Web_Assessment_Studio_Project&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #669922; font-weight: bold; text-decoration: none;&quot;&gt;Pantera&lt;/a&gt;是OWASP提供之滲透測試軟體,使用需求Python、MySql、Python MySql Wrapper、OpenSSL,安裝說明請參考下載解壓縮檔後之INSTALL.txt說明&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.google.com.tw/search?q=Category%3AOWASP+Sprajax+Project&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #669922; font-weight: bold; text-decoration: none;&quot;&gt;Sprajax&lt;/a&gt;是供AJAX frameworks網站安全性測試軟體&lt;br /&gt;
&lt;a href=&quot;http://www.google.com.tw/search?q=addon+mozilla+Groundspeed+web+application+penetration+tests&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #669922; font-weight: bold; text-decoration: none;&quot;&gt;GroundSpeed&lt;/a&gt;,Firefox外掛網頁安全性檢測工具&lt;br /&gt;
&lt;br /&gt;
(GPL)&lt;a href=&quot;http://www.google.com.tw/search?q=proxmon+ProxMon++Automating+Web+Application+Penetration+Tests&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #669922; font-weight: bold; text-decoration: none;&quot;&gt;ProxMon&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
(開放源碼）&lt;a href=&quot;http://www.google.com.tw/search?q=Paros++for+web+application+security+assessment&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #669922; font-weight: bold; text-decoration: none;&quot;&gt;Paros&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.google.com.tw/search?q=Burp+Proxy+site%3Afreshmeat.net&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #669922; font-weight: bold; text-decoration: none;&quot;&gt;Burp Proxy&lt;/a&gt;,透過Proxy，以man-in-the-middle手法進行安全性測試&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.google.com.tw/search?q=SPIKE+Proxy+site%3Afreshmeat.net&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #669922; font-weight: bold; text-decoration: none;&quot;&gt;SPIKE Proxy&lt;/a&gt;,解壓縮檔案需存放於C槽之SPIKEProxy資料夾，搭配runme.bat批次檔設定Path參數後執行&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.google.com.tw/search?q=site%3Asecurityforest.com+wiki+Category%3A+Web_Applications&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #669922; font-weight: bold; text-decoration: none;&quot;&gt;相關參考資訊&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.google.com.tw/search?q=free+http+sniffer+cleanersoft&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #669922; font-weight: bold; text-decoration: none;&quot;&gt;Http Sniffer&lt;/a&gt;&amp;nbsp;,可檢視http或https網路封包資訊,查詢Port連線狀態及相關鏈結&lt;br /&gt;
&lt;a href=&quot;http://www.google.com.tw/search?q=http-ping++free+command+line+utility+%22coretechnologies%22&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #669922; font-weight: bold; text-decoration: none;&quot;&gt;http-ping&lt;/a&gt;,命令提示列方式,查詢網站是否正常回應及偵測執行時間 (http-ping -q -c http://www.example.com.tw)&lt;br /&gt;
&lt;br /&gt;
IE瀏覽器相關工具:&lt;br /&gt;
&lt;a href=&quot;http://www.google.com.tw/search?q=Final+Builds+Site++Internet+Explorer+Collection&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #669922; font-weight: bold; text-decoration: none;&quot;&gt;Internet Explorer Collection&lt;/a&gt;,提供IE相關版本供測試使用&lt;br /&gt;
&lt;a href=&quot;http://www.google.com.tw/search?q=Microsoft+Internet+Explorer+Application+Compatibility+VPC+Image&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #669922; font-weight: bold; text-decoration: none;&quot;&gt;Microsoft Internet Explorer Application Compatibility VPC Image&lt;/a&gt;,搭配&lt;a href=&quot;http://myblog-johnnyit.blogspot.com/2008/05/virtualmachine.html&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #669922; font-weight: bold; text-decoration: none;&quot;&gt;微軟VPC軟體&lt;/a&gt;,可進行不同IE版本測試&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.google.com.tw/search?q=Web%E3%82%A2%E3%83%97%E3%83%AA%E3%82%B1%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%E3%83%86%E3%82%B9%E3%83%88%E6%89%8B%E6%B3%95&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #669922; font-weight: bold; text-decoration: none;&quot;&gt;網站應用程式測試參考日文書籍&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iphoneipad-develop.blogspot.com/feeds/8562313413847507794/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/05/blog-post_29.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/8562313413847507794'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/8562313413847507794'/><link rel='alternate' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/05/blog-post_29.html' title='網站安全性測試'/><author><name>Hsin</name><uri>http://www.blogger.com/profile/11673965008839019372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHCbYEown8QoYxImaBJ7gkp4LWmPJHgIS-DE4CfqN0brLrtJHnlue_XikYX52aobHVY_wr8QGlMgbG2myV_0DtZeHMbpJr7GpclQIeYYkdEi_xRmK001m5kf3gG57zxw/s220/1.sLByIvXvAHN'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3644496878787142706.post-8245674407377092151</id><published>2011-05-21T01:46:00.001-07:00</published><updated>2011-05-21T01:46:54.036-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="義信"/><title type='text'>網站介紹</title><content type='html'>abb&lt;strong&gt;ddfefe&amp;nbsp; &lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;a href=&quot;http://yihsin.info/&quot;&gt;義信網站&lt;/a&gt;&lt;/strong&gt;</content><link rel='replies' type='application/atom+xml' href='http://iphoneipad-develop.blogspot.com/feeds/8245674407377092151/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/05/blog-post_21.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/8245674407377092151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/8245674407377092151'/><link rel='alternate' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/05/blog-post_21.html' title='網站介紹'/><author><name>Hsin</name><uri>http://www.blogger.com/profile/11673965008839019372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHCbYEown8QoYxImaBJ7gkp4LWmPJHgIS-DE4CfqN0brLrtJHnlue_XikYX52aobHVY_wr8QGlMgbG2myV_0DtZeHMbpJr7GpclQIeYYkdEi_xRmK001m5kf3gG57zxw/s220/1.sLByIvXvAHN'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3644496878787142706.post-2701281845740281581</id><published>2011-05-21T01:05:00.000-07:00</published><updated>2011-05-21T01:33:37.339-07:00</updated><title type='text'>new test</title><content type='html'>&lt;iframe src=&quot;https://spreadsheets.google.com/embeddedform?formkey=dG1zMEZaWTAyUFoxVDIzMkUzRHVHdkE6MQ&quot; width=&quot;760&quot; height=&quot;789&quot; frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot;&gt;Loading...&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://iphoneipad-develop.blogspot.com/feeds/2701281845740281581/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/05/new-test.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/2701281845740281581'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/2701281845740281581'/><link rel='alternate' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/05/new-test.html' title='new test'/><author><name>Hsin</name><uri>http://www.blogger.com/profile/11673965008839019372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHCbYEown8QoYxImaBJ7gkp4LWmPJHgIS-DE4CfqN0brLrtJHnlue_XikYX52aobHVY_wr8QGlMgbG2myV_0DtZeHMbpJr7GpclQIeYYkdEi_xRmK001m5kf3gG57zxw/s220/1.sLByIvXvAHN'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3644496878787142706.post-6985762420760703056</id><published>2011-05-20T07:38:00.001-07:00</published><updated>2011-05-20T07:38:40.928-07:00</updated><title type='text'></title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;圖片測試&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjugLXi-iVD3Ibb9TBovSsY1BV_jgPJjsAnN7XuFATqpzuDNn9ohaWQSvG32byo30mtwT-ZiawKpbfUEFxZIgzTWA1V3nZPNW4N33BSAESulOWOepff-ARLrX8np_gb5NXtRxtAVR-_Exc/s1600/%25E7%259F%25A5%25E8%25AD%2598%25E7%25A7%2591%25E6%258A%2580%25E6%259C%2589%25E9%2599%2590%25E5%2585%25AC%25E5%258F%25B8+%25E8%2587%25B3+%25E7%258F%258A%25E7%2591%259A%25E8%25B7%25AF-%25E5%258D%2597111%25E9%2584%2589%25E9%2581%2593+-+Google+%25E5%259C%25B0%25E5%259C%2596.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;190&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjugLXi-iVD3Ibb9TBovSsY1BV_jgPJjsAnN7XuFATqpzuDNn9ohaWQSvG32byo30mtwT-ZiawKpbfUEFxZIgzTWA1V3nZPNW4N33BSAESulOWOepff-ARLrX8np_gb5NXtRxtAVR-_Exc/s320/%25E7%259F%25A5%25E8%25AD%2598%25E7%25A7%2591%25E6%258A%2580%25E6%259C%2589%25E9%2599%2590%25E5%2585%25AC%25E5%258F%25B8+%25E8%2587%25B3+%25E7%258F%258A%25E7%2591%259A%25E8%25B7%25AF-%25E5%258D%2597111%25E9%2584%2589%25E9%2581%2593+-+Google+%25E5%259C%25B0%25E5%259C%2596.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;功能導覽</content><link rel='replies' type='application/atom+xml' href='http://iphoneipad-develop.blogspot.com/feeds/6985762420760703056/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/05/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/6985762420760703056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/6985762420760703056'/><link rel='alternate' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/05/blog-post.html' title=''/><author><name>Hsin</name><uri>http://www.blogger.com/profile/11673965008839019372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHCbYEown8QoYxImaBJ7gkp4LWmPJHgIS-DE4CfqN0brLrtJHnlue_XikYX52aobHVY_wr8QGlMgbG2myV_0DtZeHMbpJr7GpclQIeYYkdEi_xRmK001m5kf3gG57zxw/s220/1.sLByIvXvAHN'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjugLXi-iVD3Ibb9TBovSsY1BV_jgPJjsAnN7XuFATqpzuDNn9ohaWQSvG32byo30mtwT-ZiawKpbfUEFxZIgzTWA1V3nZPNW4N33BSAESulOWOepff-ARLrX8np_gb5NXtRxtAVR-_Exc/s72-c/%25E7%259F%25A5%25E8%25AD%2598%25E7%25A7%2591%25E6%258A%2580%25E6%259C%2589%25E9%2599%2590%25E5%2585%25AC%25E5%258F%25B8+%25E8%2587%25B3+%25E7%258F%258A%25E7%2591%259A%25E8%25B7%25AF-%25E5%258D%2597111%25E9%2584%2589%25E9%2581%2593+-+Google+%25E5%259C%25B0%25E5%259C%2596.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3644496878787142706.post-6615305440257878008</id><published>2011-03-29T18:03:00.000-07:00</published><updated>2011-03-29T18:30:23.315-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="delegate"/><title type='text'>淺嘗 delegate</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-family: 微軟正黑體, &#39;Helvetica Neue&#39;, Arial, Helvetica, Geneva, sans-serif; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-family: 微軟正黑體, &#39;Helvetica Neue&#39;, Arial, Helvetica, Geneva, sans-serif; line-height: 18px;&quot;&gt;delegate &amp;nbsp;若對C語言比較熟，其目的有點像是 function pointer。&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 微軟正黑體, &#39;Helvetica Neue&#39;, Arial, Helvetica, Geneva, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 18px;&quot;&gt;在 C語言寫作時，我們為了要撰寫 像是&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 微軟正黑體, &#39;Helvetica Neue&#39;, Arial, Helvetica, Geneva, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 18px;&quot;&gt;1. &amp;nbsp;call back function，亦即執行某個程式，而在程式結束之後，自動返回。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 微軟正黑體, &#39;Helvetica Neue&#39;, Arial, Helvetica, Geneva, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 18px;&quot;&gt;2. 在compile期間，尚不知道會給哪個 function進行。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 微軟正黑體, &#39;Helvetica Neue&#39;, Arial, Helvetica, Geneva, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 微軟正黑體, &#39;Helvetica Neue&#39;, Arial, Helvetica, Geneva, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 微軟正黑體, &#39;Helvetica Neue&#39;, Arial, Helvetica, Geneva, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 18px;&quot;&gt;參考developer.apple.com的說明&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;blockquote&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 微軟正黑體, &#39;Helvetica Neue&#39;, Arial, Helvetica, Geneva, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: #666666; font-family: &#39;Lucida Grande&#39;, Geneva, Helvetica, Arial, sans-serif; line-height: 20px;&quot;&gt;Delegation is a simple and powerful pattern in which one object in a program acts on behalf of, or in coordination with, another object.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #666666; font-family: &#39;Lucida Grande&#39;, Geneva, Helvetica, Arial, sans-serif; line-height: 20px;&quot;&gt;The delegating object keeps a reference to the other object—the delegate—and at the appropriate time sends a message to it. The message informs the delegate of an event that the delegating object is about to handle or has just handled. The delegate may respond to the message by updating the appearance or state of itself or other objects in the application, and in some cases it can return a value that affects how an impending event is handled. The main value of delegation is that it allows you to easily customize the behavior of several objects in one central object.&lt;/span&gt;&lt;/blockquote&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 微軟正黑體, &#39;Helvetica Neue&#39;, Arial, Helvetica, Geneva, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 18px;&quot;&gt;換言之，這就像是 我知道 要完成一個任務，需要a技能，而 &quot;小寶&quot; 他有a技能，那麼我就delegate給小寶，並在需要的時候，委由小寶幫我執行。&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 微軟正黑體, &#39;Helvetica Neue&#39;, Arial, Helvetica, Geneva, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 微軟正黑體, &#39;Helvetica Neue&#39;, Arial, Helvetica, Geneva, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 18px;&quot;&gt;因此像底下的例子 &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: monospace; font-size: 12px; white-space: pre;&quot;&gt;HelloAppDelegate 有&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: monospace; font-size: 12px; white-space: pre;&quot;&gt;&amp;lt;UIApplicationDelegate&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-collapse: collapse; font-family: monospace; font-size: 12px; white-space: pre;&quot;&gt;HelloAppDelegate 就需要處理  &lt;/span&gt;&lt;strong&gt;applicationDidFinishLaunching、&lt;/strong&gt;&lt;strong&gt;applicationWillTerminate、&lt;/strong&gt;&lt;strong&gt;applicationDidReceiveMemoryWarning....等。&lt;/strong&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 微軟正黑體, &#39;Helvetica Neue&#39;, Arial, Helvetica, Geneva, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 微軟正黑體, &#39;Helvetica Neue&#39;, Arial, Helvetica, Geneva, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 微軟正黑體, &#39;Helvetica Neue&#39;, Arial, Helvetica, Geneva, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: 18px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 微軟正黑體, &#39;Helvetica Neue&#39;, Arial, Helvetica, Geneva, sans-serif;&quot;&gt;物件中 has a的關係在大部份的Design Pattern書籍中，將之說成Delegate(委派)。&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 微軟正黑體, &#39;Helvetica Neue&#39;, Arial, Helvetica, Geneva, sans-serif;&quot;&gt;設計類別時，在一般情況下應儘量使用委派(delegate)而少用繼承。&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 微軟正黑體, &#39;Helvetica Neue&#39;, Arial, Helvetica, Geneva, sans-serif;&quot;&gt;以委派取代繼承的時機：某個subclass只使用super classes 介面中的一部份，或是根本沒用到繼承而來的資料。&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 微軟正黑體, &#39;Helvetica Neue&#39;, Arial, Helvetica, Geneva, sans-serif;&quot;&gt;以繼承取代委派的時機：當在二個classes中使用delegate，並經常為二個classes間寫作許多簡單的delegate function。&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; color: #5c635c; font-family: 微軟正黑體, &#39;Helvetica Neue&#39;, Arial, Helvetica, Geneva, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; color: #5c635c; font-family: 微軟正黑體, &#39;Helvetica Neue&#39;, Arial, Helvetica, Geneva, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; color: #5c635c; font-family: 微軟正黑體, &#39;Helvetica Neue&#39;, Arial, Helvetica, Geneva, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; color: #5c635c; font-family: 微軟正黑體, &#39;Helvetica Neue&#39;, Arial, Helvetica, Geneva, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; color: #5c635c; font-family: 微軟正黑體, &#39;Helvetica Neue&#39;, Arial, Helvetica, Geneva, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; color: #5c635c; font-family: 微軟正黑體, &#39;Helvetica Neue&#39;, Arial, Helvetica, Geneva, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;(資料來源：&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://blog.joomla.org.tw/iphone-ipad/112-delegate-controller1.html&quot;&gt;http://blog.joomla.org.tw/iphone-ipad/112-delegate-controller1.html&lt;/a&gt;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; color: #5c635c; font-family: 微軟正黑體, &#39;Helvetica Neue&#39;, Arial, Helvetica, Geneva, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; color: #5c635c; font-family: 微軟正黑體, &#39;Helvetica Neue&#39;, Arial, Helvetica, Geneva, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;這一陣子學了不少的應用和實作許多相關的開發學習範例。最近最有疑問的是有關於Delegate（委託）和Controller（控制者）的相關性，這兩個看起來似乎很像，但又有些不同。找了不少相關的資料之後，大致上有了一些結論，把它整理到這裡。&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Delegate實際上也是一種Design Pattern（設計模式），在官方的&lt;a href=&quot;http://developer.apple.com/iPhone/library/documentation/General/Conceptual/DevPedia-CocoaCore/Delegation.html&quot; style=&quot;color: #990000; text-decoration: underline;&quot; target=&quot;_blank&quot;&gt;文件中&lt;/a&gt;，有很清楚的說明這個的運作過程：&lt;/div&gt;&lt;blockquote style=&quot;background-color: #fcfcfc; border-bottom-color: rgb(100, 132, 151); border-bottom-style: solid; border-bottom-width: 4px; border-left-color: rgb(100, 132, 151); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(100, 132, 151); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(100, 132, 151); border-top-style: solid; border-top-width: 1px; font-style: italic; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;&quot;&gt;The delegating object is typically a framework object, and the delegate is typically a custom controller object. The delegating object holds a weak reference to its delegate.&lt;/blockquote&gt;&lt;blockquote style=&quot;background-color: #fcfcfc; border-bottom-color: rgb(100, 132, 151); border-bottom-style: solid; border-bottom-width: 4px; border-left-color: rgb(100, 132, 151); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(100, 132, 151); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(100, 132, 151); border-top-style: solid; border-top-width: 1px; font-style: italic; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;&quot;&gt;&quot;進行委託的&quot;物件（稱為host object）基本上是一個框架物件，而&quot;委託代表&quot;是基本上是一個自訂的控制者物件。進行委託的物件維繫一個弱的參考到它的代表。&lt;/blockquote&gt;&lt;br /&gt;
在上述文件的例子中，使用者在視窗上點下關閉的按鈕，視窗會送出一個訊息給委託代表，由委託代表負責回應是不是可以關閉這個視窗。這是一個最簡單的委託的例子。&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;文件在接下來的說明又談到另一個設計模式，稱為Observer（觀察者）模式，委託和notification（通知）之間的關係在於，委託代表在Cocoa中會自動成為訊息的觀察者，訊息會在事件發生之後產生，用廣播的方式通知所有的觀察者，這是這個模式的主要實作的用途。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;至於最後一項稱為data source（資料源），字義上看起來似乎是MVC中的Model部份，實際並不是，它也是一種委託代表，和上述的委託代表不同處，在於委託它的物件，從上述的UI（使用者操作介面），換成了資料。&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;委託在實作的部份，都是透過protocol（協定）的方式，Objective-C的protocol的行為類似Java中interface。在Cocoa中，可以在NSApplication, UIApplication, UITableView, 和NSView的子類別中看到委託的設計。以下是有關於iPhone OS的委託說明：&lt;/div&gt;&lt;blockquote style=&quot;background-color: #fcfcfc; border-bottom-color: rgb(100, 132, 151); border-bottom-style: solid; border-bottom-width: 4px; border-left-color: rgb(100, 132, 151); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(100, 132, 151); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(100, 132, 151); border-top-style: solid; border-top-width: 1px; font-style: italic; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;&quot;&gt;The application delegate is extremely important in an application running on iPhone OS, as it must respond to application-launch, application-quit, low-memory, and other messages from the application object. The application delegate must adopt the UIApplicationDelegate protocol.&lt;/blockquote&gt;&lt;blockquote style=&quot;background-color: #fcfcfc; border-bottom-color: rgb(100, 132, 151); border-bottom-style: solid; border-bottom-width: 4px; border-left-color: rgb(100, 132, 151); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(100, 132, 151); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(100, 132, 151); border-top-style: solid; border-top-width: 1px; font-style: italic; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;&quot;&gt;在iPhone OS上執行的應用程式中應用程式委託是非常重要的，因為它需要回應程式的開始執行、程式關閉、低記憶體及其他從程式物件中發出的訊息。應用程式委託需要採用UIApplicationDelegate協定。&lt;/blockquote&gt;&lt;/div&gt;&lt;br /&gt;
當然目前我所接觸到的，最常見的只有這個UIApplicationDelegate，在每個iPhone的應用程式都可以看到一個委託的檔案，例如在最基本的Hello範例中：&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;rj_insertcode&quot;&gt;&lt;div class=&quot;rj_insertcode_objc&quot;&gt;&lt;table class=&quot;objc&quot; style=&quot;background-color: #f8f8f8; border-collapse: collapse; border: 1px solid rgb(5, 75, 110); height: 232px; width: 510px;&quot;&gt;&lt;thead&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;background-color: #dddddd; color: #054b6e; font-family: Verdana,Geneva,Arial,Helvetica,sans-serif; font-size-adjust: none; font-size: 12px; font-stretch: normal; font-style: italic; font-variant: normal; font-weight: bold; line-height: normal; padding: 2px 0px; text-align: center;&quot;&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;HelloAppDelegate.h&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/thead&gt;&lt;tbody&gt;
&lt;tr class=&quot;li1&quot;&gt;&lt;td style=&quot;background-color: #f0f0f0; border-right: 1px dotted rgb(221, 221, 221); color: #676f73; font-size: 12px; text-align: right; vertical-align: top; width: 1px;&quot;&gt;&lt;pre style=&quot;background-image: none; font-size: 12px; margin: 0px; padding: 0px 4px; vertical-align: top;&quot;&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14&lt;/pre&gt;&lt;/td&gt;&lt;td style=&quot;background-image: none; font-size: 12px; margin: 0px; padding: 0px 4px; vertical-align: top;&quot;&gt;&lt;pre style=&quot;background-image: none; font-size: 12px; margin: 0px; padding: 0px 4px; vertical-align: top;&quot;&gt;&lt;span style=&quot;vertical-align: top;&quot;&gt;&lt;span style=&quot;color: #6e371a;&quot;&gt;#import &amp;lt;UIKit/UIKit.h&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/span&gt;
&lt;span style=&quot;vertical-align: top;&quot;&gt;&lt;span style=&quot;color: #a61390;&quot;&gt;@class&lt;/span&gt; HelloViewController;&lt;/span&gt;
&lt;span style=&quot;vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/span&gt;
&lt;span style=&quot;vertical-align: top;&quot;&gt;&lt;span style=&quot;color: #11740a; font-style: italic;&quot;&gt;//START:code.HelloAppDelegate.interface&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;vertical-align: top;&quot;&gt;&lt;span style=&quot;color: #a61390;&quot;&gt;@interface&lt;/span&gt; HelloAppDelegate &lt;span style=&quot;color: #002200;&quot;&gt;:&lt;/span&gt; &lt;a href=&quot;http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSObject_Class/&quot; style=&quot;color: #990000; text-decoration: underline;&quot;&gt;&lt;span style=&quot;color: #400080;&quot;&gt;NSObject&lt;/span&gt;&lt;/a&gt; &amp;lt;UIApplicationDelegate&amp;gt; &lt;span style=&quot;color: #002200;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;vertical-align: top;&quot;&gt; IBOutlet UIWindow &lt;span style=&quot;color: #002200;&quot;&gt;*&lt;/span&gt;window;&lt;/span&gt;
&lt;span style=&quot;vertical-align: top;&quot;&gt; IBOutlet HelloViewController &lt;span style=&quot;color: #002200;&quot;&gt;*&lt;/span&gt;viewController;&lt;/span&gt;
&lt;span style=&quot;vertical-align: top;&quot;&gt;&lt;span style=&quot;color: #002200;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/span&gt;
&lt;span style=&quot;vertical-align: top;&quot;&gt;&lt;span style=&quot;color: #a61390;&quot;&gt;@property&lt;/span&gt; &lt;span style=&quot;color: #002200;&quot;&gt;(&lt;/span&gt;nonatomic, retain&lt;span style=&quot;color: #002200;&quot;&gt;)&lt;/span&gt; UIWindow &lt;span style=&quot;color: #002200;&quot;&gt;*&lt;/span&gt;window;&lt;/span&gt;
&lt;span style=&quot;vertical-align: top;&quot;&gt;&lt;span style=&quot;color: #a61390;&quot;&gt;@property&lt;/span&gt; &lt;span style=&quot;color: #002200;&quot;&gt;(&lt;/span&gt;nonatomic, retain&lt;span style=&quot;color: #002200;&quot;&gt;)&lt;/span&gt; HelloViewController &lt;span style=&quot;color: #002200;&quot;&gt;*&lt;/span&gt;viewController;&lt;/span&gt;
&lt;span style=&quot;vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/span&gt;
&lt;span style=&quot;vertical-align: top;&quot;&gt;&lt;span style=&quot;color: #a61390;&quot;&gt;@end&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 10px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;第6行就有宣告要使用&lt;a href=&quot;http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIApplicationDelegate_Protocol/Reference/Reference.html&quot; style=&quot;color: #990000; text-decoration: underline;&quot; target=&quot;_blank&quot;&gt;UIApplicationDelegate協定&lt;/a&gt;。在這個委託中可以實作的方法又有那些？對照上述的官方敘述，有以下的方法可以應用（只是大概列出一些，詳情請參考上面連結）：&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;list-style-position: inside; margin-bottom: 0px; margin-left: 20px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li&gt;「&lt;strong&gt;applicationDidFinishLaunching:&lt;/strong&gt;」程式啟動完成後通知，這裡通常會加入應用程式的初始化的工作&lt;/li&gt;
&lt;li&gt;「&lt;strong&gt;applicationWillTerminate:&lt;/strong&gt;」程式結束前通知，結束前應作好重要設定或資料的儲存，例如遊戲應儲存目前的狀態，下次才能從這個狀態再繼續。&lt;/li&gt;
&lt;li&gt;「&lt;strong&gt;applicationDidReceiveMemoryWarning:&lt;/strong&gt;」程式收到系統通知記憶體警告，如果收到警告後不釋放足夠的記憶體，系統將會強制中止程式。（註：之類後會談到UIViewController中的didReceiveMemoryWarning方法，類似功用 ）&lt;/li&gt;
&lt;li&gt;「&lt;strong&gt;applicationWillResignActive:&lt;/strong&gt;」程式將進入無效狀態通知，系統收到郵件或來電時、iPhone上鎖的通知，程式委託將不再接受任何的互動操作。程式要在此作一些暫時停止運作的工作。&lt;/li&gt;
&lt;li&gt;「&lt;strong&gt;applicationDidBecomeActive:&lt;/strong&gt;」程式將回復原本的有效狀態，並繼續原來的工作。&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;
委託在許屬控制元件中很常見，例如在使用UIWebView、UIPickerView、UITableView、UITextField這些控制元件時，也有自己對應的&lt;a href=&quot;http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIWebViewDelegate_Protocol/Reference/Reference.html&quot; style=&quot;color: #990000; text-decoration: underline;&quot; target=&quot;_blank&quot;&gt;UIWebViewDelegate&lt;/a&gt;、&lt;a href=&quot;http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIPickerViewDelegate_Protocol/Reference/UIPickerViewDelegate.html#//apple_ref/doc/uid/TP40006924-CH3-SW8&quot; style=&quot;color: #990000; text-decoration: underline;&quot; target=&quot;_blank&quot;&gt;UIPickerViewDelegate&lt;/a&gt;、&lt;a href=&quot;http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UITableViewDelegate_Protocol/Reference/Reference.html#//apple_ref/doc/uid/TP40006942&quot; style=&quot;color: #990000; text-decoration: underline;&quot; target=&quot;_blank&quot;&gt;UITableViewDelegate&lt;/a&gt;、&lt;a href=&quot;http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UITextFieldDelegate_Protocol/UITextFieldDelegate/UITextFieldDelegate.html#//apple_ref/doc/uid/TP40006991&quot; style=&quot;color: #990000; text-decoration: underline;&quot;&gt;UITextFieldDelegate&lt;/a&gt;協定，那倒底有那些控製元件有對應的委託協定？&lt;a href=&quot;http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIKit_Framework/index.html#//apple_ref/doc/uid/TP40006955&quot; style=&quot;color: #990000; text-decoration: underline;&quot; target=&quot;_blank&quot;&gt;這份表&lt;/a&gt;中的Protocol References列出了所有UIKit系列的委託和資料源協定。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div id=&quot;&quot;&gt;總結一下委託的機制用法，委託即是會自動收到在某些應用程式事件發生時的通知，在這些事件發生時的前或後，可以讓你作一些工作。&lt;/div&gt;&lt;/div&gt;&lt;div id=&quot;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div id=&quot;&quot;&gt;上一篇談到有關於Delegate的概念，那Delegate和Controller又有什麼關係？先了解所謂的MVC設計模式，就可以很清楚的了解Controller的意義是什麼了，以下是一張來自&lt;a href=&quot;http://developer.apple.com/iPhone/library/documentation/General/Conceptual/DevPedia-CocoaCore/ControllerObject.html&quot; style=&quot;color: #990000; text-decoration: underline;&quot; target=&quot;_blank&quot;&gt;官方文件Controller object&lt;/a&gt;的解說圖片：&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;div&gt;&lt;img alt=&quot;image: Art/controller_object.jpg&quot; src=&quot;http://developer.apple.com/iPhone/library/documentation/General/Conceptual/DevPedia-CocoaCore/Art/controller_object.jpg&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;有關於Controller（控制器）的說明我把它摘錄在下面：&lt;/div&gt;&lt;blockquote style=&quot;background-color: #fcfcfc; border-bottom-color: rgb(100, 132, 151); border-bottom-style: solid; border-bottom-width: 4px; border-left-color: rgb(100, 132, 151); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(100, 132, 151); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(100, 132, 151); border-top-style: solid; border-top-width: 1px; font-style: italic; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;&quot;&gt;A controller object acts as a coordinator or as an intermediary between one or more view objects and one or more model objects. In the Model-View-Controller design pattern, a controller object (or, simply, a controller) interprets user actions and intentions made in view objects-such as when the user taps or clicks a button or enters text in a text field-and communicates new or changed data to the model objects.&lt;/blockquote&gt;&lt;blockquote style=&quot;background-color: #fcfcfc; border-bottom-color: rgb(100, 132, 151); border-bottom-style: solid; border-bottom-width: 4px; border-left-color: rgb(100, 132, 151); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(100, 132, 151); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(100, 132, 151); border-top-style: solid; border-top-width: 1px; font-style: italic; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;&quot;&gt;控制器物件扮演一個或多個的view物件和一個或多個的model物件的的協調者或是媒介。在Model-View-Controller設計模式中，一個控制器元件翻譯了使用者對view物件的動作和意圖，例如使用者觸碰或按下按鈕，或是在文字欄位中輸入文字，會傳送新的或更動的資料到model物件。&lt;/blockquote&gt;&lt;br /&gt;
在這篇文件中，雖然區分出了三種控制者物件，但特別有指出在iPhone OS中，View Controllers（視圖控制器）就是扮演Coordinating Controllers（協調控制器）的角色，協調控制器的功能如下：&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;ul style=&quot;list-style-position: inside; margin-bottom: 0px; margin-left: 20px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li&gt;Responding to delegation messages and observing notifications&lt;br /&gt;
負責委託訊息和觀察通知&lt;/li&gt;
&lt;li&gt;Responding to action messages (which are are sent by controls such as buttons when users tap or click them)&lt;br /&gt;
負責動作訊息&lt;/li&gt;
&lt;li&gt;Establishing connections between objects and performing other setup tasks, such as when the application launches&lt;br /&gt;
建立物件間的連結，和執行其他設定的工作，例如程式開發執行的工作&lt;/li&gt;
&lt;li&gt;Managing the life cycle of “owned” objects&lt;br /&gt;
管理擁有物件的生命週期&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;
而視圖控制器的其他說明如下（這段有點長 @@&quot;我去掉了一些）：&lt;/div&gt;&lt;/div&gt;&lt;blockquote style=&quot;background-color: #fcfcfc; border-bottom-color: rgb(100, 132, 151); border-bottom-style: solid; border-bottom-width: 4px; border-left-color: rgb(100, 132, 151); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(100, 132, 151); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(100, 132, 151); border-top-style: solid; border-top-width: 1px; font-style: italic; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;&quot;&gt;A view controller manages a full-screen view, which it keeps a reference to and may create or load from a nib file. The controller manages the presentation of this view and the next view ...The navigation bar and the tab bar, and all their associated presentation behavior, are managed and implemented by view controller objects. View controllers can also display modal views, respond to low-memory warnings, and rotate views when the orientation changes.&lt;br /&gt;
一個視圖控制器管理並維繫了一個參考到由nib檔案所建立或載入的一個全螢幕的視圖。控制器管理這個視圖呈現方式，以及下一個在使用者介面中要呈現的首要視圖。導覽列和分頁列，以及所有相關的呈現行為，都被視圖控制物件管理和實現。視圖控制器也可以顯示獨佔的視圖、回應低記憶體警告，以及當方向改變時旋轉視圖。&lt;br /&gt;
&lt;br /&gt;
A view controller is an instance of a subclass of UIViewController. The UIKit provides several special-purpose subclasses of UIViewController, such as UITableViewController.... View controllers are typically the delegate or data source objects for many types of framework objects.&lt;br /&gt;
視圖控制器是一個UIViewController子類別的實體。UIKit提供了一些針對特別需求的UIViewController子類別，像是UITableViewController。視圖控制器基本上是針對於許多框架物件的委託或資料源物件。&lt;/blockquote&gt;&lt;br /&gt;
透過理解控制器的功能之後，先看一下最常接觸到的UIViewController中的可用方法有那些：&lt;br /&gt;
&lt;div&gt;&lt;ul style=&quot;list-style-position: inside; margin-bottom: 0px; margin-left: 20px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li&gt;「initWithNibName: bundle:」載入nib檔案來初始化&lt;/li&gt;
&lt;li&gt;「loadView」載入視圖&lt;/li&gt;
&lt;li&gt;「viewDidLoad」在載入視圖至記憶體後會呼叫的方法&lt;/li&gt;
&lt;li&gt;「viewDidUnload」在視圖從記憶體中釋放後會呼叫的方法&lt;/li&gt;
&lt;li&gt;「viewWillAppear」當收到視圖在視窗將可見時的通知會呼叫的方法&lt;/li&gt;
&lt;li&gt;「viewWillDisappear」當收到視圖在視窗將不可見時的通知會呼叫的方法&lt;/li&gt;
&lt;li&gt;「viewDidAppear」當收到視圖已加入到視窗時的通知會呼叫的方法&lt;/li&gt;
&lt;li&gt;「viewDidDisappear」當收到視圖已去除、被覆蓋或隱藏於視窗時的通知會呼叫的方法&lt;/li&gt;
&lt;li&gt;「didReceiveMemoryWarning」收到系統傳來的記憶體警告通知後會執行的方法&lt;/li&gt;
&lt;li&gt;「shouldAutorotateToInterfaceOrientation」是否支援不同方向的旋轉視圖&lt;/li&gt;
&lt;li&gt;「willAnimateRotationToInterfaceOrientation」在進行旋轉視圖前的會執行的方法（用於調整旋轉視圖之用）&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;
這些只有列出常見的，詳細的方法可以在&lt;a href=&quot;http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html&quot; style=&quot;color: #990000; text-decoration: underline;&quot; target=&quot;_blank&quot;&gt;這個文件&lt;/a&gt;中找到。看到了嗎？這些收到訊息後或前執行的方法，都和視圖有關，可以說視圖控制器主要是用來管理和控制視圖的。執行熟悉了UIViewController之後，剩下的像繼承自這個類別的子類別有三大個：有&lt;a href=&quot;http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UITableViewController_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40007523&quot; style=&quot;color: #990000; text-decoration: underline;&quot; target=&quot;_blank&quot;&gt;UITableViewController&lt;/a&gt;、&lt;a href=&quot;http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UITabBarController_Class/Reference/Reference.html#//apple_ref/occ/cl/UITabBarController&quot; style=&quot;color: #990000; text-decoration: underline;&quot; target=&quot;_blank&quot;&gt;UITabBarController&lt;/a&gt;、&lt;a href=&quot;http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UINavigationController_Class/Reference/Reference.html#//apple_ref/occ/cl/UINavigationController&quot; style=&quot;color: #990000; text-decoration: underline;&quot; target=&quot;_blank&quot;&gt;UINavigationController&lt;/a&gt;如果能熟悉各自的應用方法，大致上Controller部份就沒問題了。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;最後要談到最前面的問題：那Delegate和Controller又有什麼關係？有何不同，我在&lt;a href=&quot;http://stackoverflow.com/questions/309651/responsibilities-of-delegates-and-controllers-in-cocoa-touch&quot; style=&quot;color: #990000; text-decoration: underline;&quot; target=&quot;_blank&quot;&gt;stackoverflow找到覺得比較好的說明&lt;/a&gt;：&lt;/div&gt;&lt;blockquote style=&quot;background-color: #fcfcfc; border-bottom-color: rgb(100, 132, 151); border-bottom-style: solid; border-bottom-width: 4px; border-left-color: rgb(100, 132, 151); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(100, 132, 151); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(100, 132, 151); border-top-style: solid; border-top-width: 1px; font-style: italic; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;&quot;&gt;A delegate is a protocol (interface) that defines methods that an object implements in order to receive specific messages from other objects. Delegates objects are most often used to receive asynchronous callbacks such as user input, I/O.&lt;br /&gt;
委記是一個協定（介面），定義了許多物件可以實作的方法，為了接收來自其他物件的特定訊息。委託物件經常使用於接收非同步的回應呼叫，例如使用者輸入或I/O。&lt;br /&gt;
&lt;br /&gt;
A controller is an object that usually contains UI elements (views, controls, etc.) and data, and both receives and send messages to the various objects within it. In many cases, a controller is a delegate and can implement several delegate protocols to receive events from multiple objects.&lt;br /&gt;
控制器是一個物件，通常其中包含UI元素（視圖、控制器…等）和資料，以及接收和傳送兩種訊息到其中的眾多物件。在大部份時候，控制器是一個委託且可以實作各種委託協定，以便可以接收來自多個物件的事件。&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;了解嗎？還是有點模糊？我的理解是Controller是在於MVC設計模式中的C這個角色，扮演Model和View的居中協調者的工作。當然ViewController的工作就是針對視圖的控制器工作，管理視圖，例如在需要的時候載入它到記憶體中，不需要時在記憶體中釋放它。要記得在iPhone OS中，通常一個視圖只會有一個視圖控制器。&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot;&gt;&lt;br /&gt;
而Delegate/data source是另一種實作事件控制的模式，也是位於MVC中C這個位置的機制，只是因為它是利用協定而非一般的子類別繼承實體而來，變成另一類處理控制的機制。但是，這兩種並不會是衝突或只能擇一使用，在很多情況下，反而是兩種都要搭配使用才能完成所需的工作。&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iphoneipad-develop.blogspot.com/feeds/6615305440257878008/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/03/delegate.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/6615305440257878008'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/6615305440257878008'/><link rel='alternate' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/03/delegate.html' title='淺嘗 delegate'/><author><name>Hsin</name><uri>http://www.blogger.com/profile/11673965008839019372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHCbYEown8QoYxImaBJ7gkp4LWmPJHgIS-DE4CfqN0brLrtJHnlue_XikYX52aobHVY_wr8QGlMgbG2myV_0DtZeHMbpJr7GpclQIeYYkdEi_xRmK001m5kf3gG57zxw/s220/1.sLByIvXvAHN'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3644496878787142706.post-4495705050429741041</id><published>2011-03-25T22:48:00.000-07:00</published><updated>2011-03-25T22:48:15.319-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="mac clean disk"/><title type='text'>iPad OS 4.3 又到了更新的時候，清理磁碟</title><content type='html'>每當 iOS推出新版，一來是怕和舊版本不相容。&lt;br /&gt;
&lt;br /&gt;
二來 每 次想昇級，還得先把 mac OSX 先往上昇，然後才能再安裝新版 SDK&lt;br /&gt;
&lt;br /&gt;
但要安裝時，又會遇到一個問題，硬碟空間不足……&lt;br /&gt;
&lt;br /&gt;
要清理磁碟，最主要是為了 要把 空間擠出來，這個時候當然是找出最大size的file，給他刪下去。&lt;br /&gt;
&lt;br /&gt;
問題是，要從哪裡找到 最大 size 的file。&lt;br /&gt;
&lt;br /&gt;
起先，還試著一個一個資料夾找，真的是超麻煩的。&lt;br /&gt;
&lt;br /&gt;
還好後來發現一個軟體，相當好用，可以把每個資料夾都 par 出來。&lt;br /&gt;
&lt;br /&gt;
讓你知道 大的檔案是哪幾個，再來考慮是不是要直接刪掉。&lt;br /&gt;
&lt;br /&gt;
OmniDiskSweeper ...&lt;br /&gt;
&lt;br /&gt;
http://www.omnigroup.com/products/omnidisksweeper/download/</content><link rel='replies' type='application/atom+xml' href='http://iphoneipad-develop.blogspot.com/feeds/4495705050429741041/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/03/ipad-os-43.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/4495705050429741041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/4495705050429741041'/><link rel='alternate' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/03/ipad-os-43.html' title='iPad OS 4.3 又到了更新的時候，清理磁碟'/><author><name>Hsin</name><uri>http://www.blogger.com/profile/11673965008839019372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHCbYEown8QoYxImaBJ7gkp4LWmPJHgIS-DE4CfqN0brLrtJHnlue_XikYX52aobHVY_wr8QGlMgbG2myV_0DtZeHMbpJr7GpclQIeYYkdEi_xRmK001m5kf3gG57zxw/s220/1.sLByIvXvAHN'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3644496878787142706.post-6988407173117050542</id><published>2011-03-16T19:21:00.000-07:00</published><updated>2011-03-16T19:21:05.166-07:00</updated><title type='text'>view Controller programming on iOS</title><content type='html'>&lt;h3 class=&quot;post-title entry-title&quot; style=&quot;color: #d52a33; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font: normal normal normal 22px/normal Georgia, Utopia, &#39;Palatino Linotype&#39;, Palatino, serif; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; position: relative;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: &#39;Lucida Grande&#39;, Geneva, Helvetica, Arial, sans-serif; line-height: normal;&quot;&gt;&lt;h1 id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot; style=&quot;font-size: 15px; font-weight: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 2px; padding-left: 0px; padding-right: 0px; padding-top: 3px; text-align: center; text-shadow: rgb(213, 213, 213) 0px 1px 0px; white-space: nowrap;&quot;&gt;&lt;a href=&quot;https://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007457&quot;&gt;View Controller Programming Guide for iOS&lt;/a&gt;&lt;/h1&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div class=&quot;post-header&quot; style=&quot;color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.6; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;div class=&quot;post-header-line-1&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;post-body entry-content&quot; style=&quot;color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.4; position: relative; width: 506px;&quot;&gt;這是一個 iPhone 軟體典型的畫面，在這個畫面，有一個 Tab bar 與 Navigation bar 的結合。&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiniuKoSPK8_rmVrXAlj6XVSkK7g_PcaubvS9EWvZWBRcKIc55ktNRpluVrTMa-2hE7GvjjhEJnQ-7bp0QOUaxdvhpNDGXBD2ZmgPBRo1av9Qu0SJhqJ4zaAHjxx_S_4hv5kfMe-j_oAng/s1600-h/vc-areas.JPEG&quot; style=&quot;color: #d52a33; text-decoration: none;&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5338115301555762834&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiniuKoSPK8_rmVrXAlj6XVSkK7g_PcaubvS9EWvZWBRcKIc55ktNRpluVrTMa-2hE7GvjjhEJnQ-7bp0QOUaxdvhpNDGXBD2ZmgPBRo1av9Qu0SJhqJ4zaAHjxx_S_4hv5kfMe-j_oAng/s320/vc-areas.JPEG&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.199219) 0px 0px 20px; background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(204, 204, 204); border-bottom-left-radius: 5px 5px; border-bottom-right-radius: 5px 5px; border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; border-top-style: solid; border-top-width: 1px; border-width: initial; box-shadow: rgba(0, 0, 0, 0.199219) 0px 0px 20px; cursor: pointer; height: 320px; padding-bottom: 8px; padding-left: 8px; padding-right: 8px; padding-top: 8px; position: relative; width: 313px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
可以先讀&lt;/div&gt;&lt;div class=&quot;post-body entry-content&quot; style=&quot;color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.4; position: relative; width: 506px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: &#39;Lucida Grande&#39;, Geneva, Helvetica, Arial, sans-serif; line-height: normal;&quot;&gt;&lt;h1 id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot; style=&quot;font-size: 15px; font-weight: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 2px; padding-left: 0px; padding-right: 0px; padding-top: 3px; text-align: center; text-shadow: rgb(213, 213, 213) 0px 1px 0px; white-space: nowrap;&quot;&gt;&lt;a href=&quot;https://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007457&quot;&gt;View Controller Programming Guide for iOS&lt;/a&gt;&lt;/h1&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;post-body entry-content&quot; style=&quot;color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.4; position: relative; width: 506px;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
從 Xcode 裡 New Project 的範本裡有 Tab Bar 與 Navigation Bar，不過裡面有提到 you should never add a tab bar controller to a navigation controller，所以要先有 Tab Bar 再加入 Navigation Bar，像這樣：&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVXMuQgldmuzQZa1cUsoAcORSvLCH1x88vfUhzRYyJq4cFEnAjbTGQwwoINAQvoh4yYx6jUJCfPOYc1FRrVp9KHd_GdeeW7k_1AhHOLmTqQa4K7mFVAKI7wjvewHkuRGhbBnb1d6O1Mko/s1600-h/vc-uitabbarctlr-uinavctlr.jpg&quot; style=&quot;color: #d52a33; text-decoration: none;&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5338452148966279490&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVXMuQgldmuzQZa1cUsoAcORSvLCH1x88vfUhzRYyJq4cFEnAjbTGQwwoINAQvoh4yYx6jUJCfPOYc1FRrVp9KHd_GdeeW7k_1AhHOLmTqQa4K7mFVAKI7wjvewHkuRGhbBnb1d6O1Mko/s320/vc-uitabbarctlr-uinavctlr.jpg&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.199219) 0px 0px 20px; background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(204, 204, 204); border-bottom-left-radius: 5px 5px; border-bottom-right-radius: 5px 5px; border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; border-top-style: solid; border-top-width: 1px; border-width: initial; box-shadow: rgba(0, 0, 0, 0.199219) 0px 0px 20px; cursor: pointer; height: 320px; padding-bottom: 8px; padding-left: 8px; padding-right: 8px; padding-top: 8px; position: relative; width: 309px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://stackoverflow.com/questions/478448/how-combine-tabbar-navigation-with-xcode&quot; style=&quot;color: #d52a33; text-decoration: none;&quot;&gt;在這裡&lt;/a&gt;找到 Combining Tab Bar and Navigation Controllers 的範例。&lt;div id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot;&gt;&lt;a href=&quot;http://twilloapp.blogspot.com/2009/03/how-to-embed-navigation-controller.html&quot; style=&quot;color: #d52a33; text-decoration: none;&quot;&gt;另一份&lt;/a&gt;範例 How to embed a navigation controller inside a tab bar controller，這一份還有第二篇，講到再加入 table view controller&lt;br /&gt;
&lt;br /&gt;
***&lt;br /&gt;
&lt;br /&gt;
基本閱讀：&lt;br /&gt;
&lt;a href=&quot;http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/index.html#//apple_ref/doc/uid/TP40007072&quot; style=&quot;color: #d52a33; text-decoration: none;&quot; target=&quot;_top&quot;&gt;iPhone Application Programming Guide&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://developer.apple.com/iphone/library/documentation/UserExperience/Conceptual/MobileHIG/index.html#//apple_ref/doc/uid/TP40006556&quot; style=&quot;color: #d52a33; text-decoration: none;&quot; target=&quot;_top&quot;&gt;iPhone Human Interface Guidelines&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://developer.apple.com/iphone/library/documentation/DeveloperTools/Conceptual/IB_UserGuide/index.html#//apple_ref/doc/uid/TP40005344&quot; style=&quot;color: #d52a33; text-decoration: none;&quot; target=&quot;_top&quot;&gt;Interface Builder User Guide&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
延伸閱讀：&lt;br /&gt;
&lt;a href=&quot;http://developer.apple.com/iphone/library/documentation/UserExperience/Conceptual/TableView_iPhone/index.html#//apple_ref/doc/uid/TP40007451&quot; style=&quot;color: #d52a33; text-decoration: none;&quot; target=&quot;_top&quot;&gt;Table View Programming Guide for iPhone OS&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iphoneipad-develop.blogspot.com/feeds/6988407173117050542/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/03/view-controller-programming-on-ios.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/6988407173117050542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/6988407173117050542'/><link rel='alternate' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/03/view-controller-programming-on-ios.html' title='view Controller programming on iOS'/><author><name>Hsin</name><uri>http://www.blogger.com/profile/11673965008839019372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHCbYEown8QoYxImaBJ7gkp4LWmPJHgIS-DE4CfqN0brLrtJHnlue_XikYX52aobHVY_wr8QGlMgbG2myV_0DtZeHMbpJr7GpclQIeYYkdEi_xRmK001m5kf3gG57zxw/s220/1.sLByIvXvAHN'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiniuKoSPK8_rmVrXAlj6XVSkK7g_PcaubvS9EWvZWBRcKIc55ktNRpluVrTMa-2hE7GvjjhEJnQ-7bp0QOUaxdvhpNDGXBD2ZmgPBRo1av9Qu0SJhqJ4zaAHjxx_S_4hv5kfMe-j_oAng/s72-c/vc-areas.JPEG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3644496878787142706.post-8411174302084484051</id><published>2011-03-16T10:06:00.000-07:00</published><updated>2011-03-16T10:06:10.234-07:00</updated><title type='text'>SSH  免密碼登入</title><content type='html'>由於 使用 git ，採用 ssh 登入，但每次都需要輸入密碼 相當麻煩，因此網路上找了資料，建立public key、private key。&lt;br /&gt;
&lt;br /&gt;
在自己的 MAC 機器上&lt;br /&gt;
&lt;br /&gt;
打入&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-size: large;&quot;&gt;&lt;b&gt;(1) &lt;/b&gt;&lt;/span&gt;&amp;nbsp; ssh-keygen -t rsa &amp;nbsp; 產生中會詢問你是否要輸入 passphrase 以及兩把key所存放之位置。&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-size: large;&quot;&gt;&lt;b&gt;(2)&amp;nbsp;&lt;/b&gt;&lt;/span&gt;用 scp &amp;nbsp;[key] &amp;nbsp; username@server:[位置] &amp;nbsp; ex: &amp;nbsp;scp ~/.ssh/*.pub &amp;nbsp; abc@abc.com:~/.ssh/&lt;br /&gt;
&lt;br /&gt;
但需注意 在 abc.com 上面 abc的家目錄，需要先有 .ssh 資料夾&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-size: large;&quot;&gt;&lt;b&gt;(3)&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Monaco, &#39;Trebuchet MS&#39;, Verdana; font-size: 12px; line-height: 18px;&quot;&gt;$ cat ~/.ssh/id_rsa.pub &amp;gt;&amp;gt; ~/.ssh/authorized_keys&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Monaco, &#39;Trebuchet MS&#39;, Verdana; font-size: 12px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Monaco, &#39;Trebuchet MS&#39;, Verdana; font-size: 12px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Arial; font-size: large; line-height: normal;&quot;&gt;&lt;b&gt;(4) 改權限&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Monaco, &#39;Trebuchet MS&#39;, Verdana; font-size: 12px; line-height: 18px;&quot;&gt;$ chmod 711 ~/.ssh&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Monaco, &#39;Trebuchet MS&#39;, Verdana; font-size: 12px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: Arial; font-size: large; line-height: normal;&quot;&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Monaco, &#39;Trebuchet MS&#39;, Verdana; font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp;&amp;nbsp; $ chmod 644 ~/.ssh/authorized_keys&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
使用 smart git&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
原文請參閱&lt;br /&gt;
&lt;a href=&quot;http://josephjiang.com/article/understand-ssh-key/&quot;&gt;http://josephjiang.com/article/understand-ssh-key/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h2 style=&quot;font-family: arial, helvetica, clean, sans-serif; font-size: 16px; font-weight: bold; line-height: 19px; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;一、基本流程說明&lt;/h2&gt;&lt;h3 style=&quot;font-family: arial, helvetica, clean, sans-serif; font-size: 14px; font-weight: bold; line-height: 19px; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;1. 私密與公開金鑰&lt;/h3&gt;&lt;div style=&quot;font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;以 SSH 登入任何主機都必需要打帳號、密碼，除了&lt;em style=&quot;color: #990000; font-style: normal; font-weight: normal;&quot;&gt;不方便&lt;/em&gt;、另外還&lt;em style=&quot;color: #990000; font-style: normal; font-weight: normal;&quot;&gt;增加了被竊取的風險&lt;/em&gt;（有些軟體如 winscp 是可儲存的）。&lt;br /&gt;
解決的方式就是使用&lt;em style=&quot;color: #990000; font-style: normal; font-weight: normal;&quot;&gt;金鑰產生器&lt;/em&gt;來產生一筆&lt;em style=&quot;color: #990000; font-style: normal; font-weight: normal;&quot;&gt;公開金鑰&lt;/em&gt;（Public Key）與&lt;em style=&quot;color: #990000; font-style: normal; font-weight: normal;&quot;&gt;私密金鑰&lt;/em&gt;（Private Key）對應做免密碼的登入。&lt;br /&gt;
使用者只需&lt;em style=&quot;color: #990000; font-style: normal; font-weight: normal;&quot;&gt;將公開金鑰的內容附加系統上特定的檔案中&lt;/em&gt;，以及&lt;em style=&quot;color: #990000; font-style: normal; font-weight: normal;&quot;&gt;在自己的環境指定好私密金鑰&lt;/em&gt;，系統在登入流程中即會自動對應，正確無誤即可登入。&lt;br /&gt;
讓整個登入流程快速且安全。&lt;/div&gt;&lt;h3 style=&quot;font-family: arial, helvetica, clean, sans-serif; font-size: 14px; font-weight: bold; line-height: 19px; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;2. 金鑰種類&lt;/h3&gt;&lt;div style=&quot;font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;但是對應並沒有想像中這麼簡單，就像是木門上只能裝喇吧鎖而無法裝大鎖，&lt;em style=&quot;color: #990000; font-style: normal; font-weight: normal;&quot;&gt;不同的主機所能使用的金鑰機制也有所不同&lt;/em&gt;：&lt;br /&gt;
SSH 有 Protocol 1 及 Protocol 2 兩種，常見金鑰編碼機制則有 RSA1、RSA2、以及 DSA 等三種。&lt;/div&gt;&lt;h3 style=&quot;font-family: arial, helvetica, clean, sans-serif; font-size: 14px; font-weight: bold; line-height: 19px; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;3. 保護金鑰的措施&lt;/h3&gt;&lt;div style=&quot;font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;而另外一個問題，如果有人拿到了你的私密金鑰，就相當於他可以在你的主機為所欲為。&lt;br /&gt;
保護的措施就是使用&amp;nbsp;&lt;em style=&quot;color: #990000; font-style: normal; font-weight: normal;&quot;&gt;Passphrase&lt;/em&gt;（也可以不設）、私密金鑰的密碼，每次要用時就得輸入。&lt;/div&gt;&lt;h3 style=&quot;font-family: arial, helvetica, clean, sans-serif; font-size: 14px; font-weight: bold; line-height: 19px; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;4. Agent 機制&lt;/h3&gt;&lt;div style=&quot;font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;有 Passphrase 保護當然是安全多了，但原本想用金鑰的好處就是可以省去每次打密碼的步驟，&lt;br /&gt;
現在若每次又得打 Passphrase，這樣的好處就沒有了，可能還得多記一套密碼、增加打錯的可能性。&lt;br /&gt;
還好有 Agent 機制，他相當是你的&lt;em style=&quot;color: #990000; font-style: normal; font-weight: normal;&quot;&gt;管家&lt;/em&gt;、我們只要&lt;em style=&quot;color: #990000; font-style: normal; font-weight: normal;&quot;&gt;把鑰匙及 Passphrase 請他保管&lt;/em&gt;，在登入主機時他就會&lt;em style=&quot;color: #990000; font-style: normal; font-weight: normal;&quot;&gt;幫你解決輸入 Passphrase 的問題&lt;/em&gt;。&lt;/div&gt;&lt;div style=&quot;font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;block&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;h2 style=&quot;font-size: 16px; font-weight: bold; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;二、一步一步教到會&lt;/h2&gt;&lt;div style=&quot;margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;以下就只針對 Mac OSX 及 *nix 系統做介紹（若你是使用 Windows 中的 PuTTY，請先做完步驟一與二，再看&lt;a href=&quot;http://josephj.com/article/putty-key/&quot; style=&quot;color: #1a66cb; text-decoration: none;&quot;&gt;這裡&lt;/a&gt;）：&lt;/div&gt;&lt;h3 style=&quot;font-size: 14px; font-weight: bold; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;a href=&quot;&quot; name=&quot;step1&quot; style=&quot;text-decoration: none;&quot;&gt;步驟 1. 產生金鑰&lt;/a&gt;&lt;/h3&gt;&lt;div style=&quot;margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;在 Command Line 中你可以使用 ssh-keygen 來產生各種類的金鑰，而我也會鼓勵大家&lt;em style=&quot;color: #990000; font-style: normal; font-weight: normal;&quot;&gt;一次把三種金鑰產生好&lt;/em&gt;，省得碰到不同系統麻煩。&lt;/div&gt;&lt;h4 style=&quot;font-size: 13px; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;a. 產生 RSA 1 金鑰&lt;/h4&gt;&lt;div style=&quot;margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;這種金鑰是給比較舊的系統，例如 FreeBSD 4 及以前的版本、是走 SSH Protocol 1 的，最好就使用 RSA 1 這種金鑰&lt;/div&gt;&lt;code class=&quot;command-line&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #333333; display: block; font-family: Monaco, &#39;Trebuchet MS&#39;, Verdana; font-size: 12px; font-style: normal; font-weight: normal; line-height: 1.5; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 8px; padding-bottom: 8px; padding-left: 8px; padding-right: 8px; padding-top: 8px;&quot;&gt;$&amp;nbsp;&lt;strong style=&quot;color: #990000; font-style: normal; font-weight: normal;&quot;&gt;ssh-keygen -t rsa1&lt;/strong&gt;&lt;br /&gt;
Generating RSA keys: Key generation complete.&lt;br /&gt;
Enter file in which to save the key ($HOME/.ssh/identity): [按 Enter 使用預設值（建議）]&lt;br /&gt;
Enter passphrase:&amp;nbsp;&lt;em style=&quot;color: #336699; font-style: normal; font-weight: normal;&quot;&gt;輸入你的 Passphrase&lt;/em&gt;&amp;nbsp;[建議要使用 passphrase，最少 9 碼]&lt;br /&gt;
Enter same passphrase again:&amp;nbsp;&lt;em style=&quot;color: #336699; font-style: normal; font-weight: normal;&quot;&gt;再一次輸入你的 Passphrase&lt;/em&gt;&lt;br /&gt;
Your identification has been saved in /home/username/.ssh/identity.&lt;br /&gt;
Your public key has been saved in /home/username/.ssh/identity.pub.&lt;br /&gt;
The key fingerprint is: 6c:96:8c:a8:86:1b:3b:eb:1b:48:8d:3d:8d:c1:4f:dc username@abc.com&lt;/code&gt;&lt;h4 style=&quot;font-size: 13px; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;b. 產生 RSA 2 金鑰&lt;/h4&gt;&lt;div style=&quot;margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;比較新的系統，如 FreeBSD 5 及之後版本或 Linux，用 RSA 2 或 DSA 這兩種金鑰&lt;/div&gt;&lt;code class=&quot;command-line&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #333333; display: block; font-family: Monaco, &#39;Trebuchet MS&#39;, Verdana; font-size: 12px; font-style: normal; font-weight: normal; line-height: 1.5; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 8px; padding-bottom: 8px; padding-left: 8px; padding-right: 8px; padding-top: 8px;&quot;&gt;$&amp;nbsp;&lt;strong style=&quot;color: #990000; font-style: normal; font-weight: normal;&quot;&gt;ssh-keygen -t rsa&lt;/strong&gt;&lt;br /&gt;
Generating public/private rsa key pair.&lt;br /&gt;
Enter file in which to save the key (/home/username/.ssh/id_rsa): [按 Enter 使用預設值（建議）]&lt;br /&gt;
Enter passphrase:&amp;nbsp;&lt;em style=&quot;color: #336699; font-style: normal; font-weight: normal;&quot;&gt;輸入你的 Passphrase&lt;/em&gt;&lt;br /&gt;
Enter same passphrase again:&amp;nbsp;&lt;em style=&quot;color: #336699; font-style: normal; font-weight: normal;&quot;&gt;再一次輸入你的 Passphrase&lt;/em&gt;&lt;br /&gt;
Your identification has been saved in /home/username/.ssh/id_rsa.&lt;br /&gt;
Your public key has been saved in /home/username/.ssh/id_rsa.pub.&lt;br /&gt;
The key fingerprint is: cc:e8:a9:da:a3:41:c6:a9:97:52:59:ef:0c:cf:45:b6 username@abc.com&lt;/code&gt;&lt;h4 style=&quot;font-size: 13px; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;c. 產生 DSA 金鑰&lt;/h4&gt;&lt;code class=&quot;command-line&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #333333; display: block; font-family: Monaco, &#39;Trebuchet MS&#39;, Verdana; font-size: 12px; font-style: normal; font-weight: normal; line-height: 1.5; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 8px; padding-bottom: 8px; padding-left: 8px; padding-right: 8px; padding-top: 8px;&quot;&gt;$&amp;nbsp;&lt;strong style=&quot;color: #990000; font-style: normal; font-weight: normal;&quot;&gt;ssh-keygen -t dsa&lt;/strong&gt;&lt;br /&gt;
Generating public/private dsa key pair.&lt;br /&gt;
Enter file in which to save the key (/home/username/.ssh/id_dsa): [按 Enter 使用預設值（建議）]&lt;br /&gt;
Enter passphrase:&amp;nbsp;&lt;em style=&quot;color: #336699; font-style: normal; font-weight: normal;&quot;&gt;輸入你的 Passphrase&lt;/em&gt;&lt;br /&gt;
Enter same passphrase again:&amp;nbsp;&lt;em style=&quot;color: #336699; font-style: normal; font-weight: normal;&quot;&gt;再一次輸入你的 Passphrase&lt;/em&gt;&lt;br /&gt;
Your identification has been saved in /home/username/.ssh/id_dsa.&lt;br /&gt;
Your public key has been saved in /home/username/.ssh/id_dsa.pub.&lt;br /&gt;
The key fingerprint is: cc:e8:a9:da:a3:41:c6:a9:97:52:59:ef:0c:cf:45:b6 username@abc.com&lt;/code&gt;&lt;div style=&quot;margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;經過這樣的程序，我們總共會有公私鑰共三對：RSA1 ( identity.pub / identity )、RSA2 ( id_rsa.pub / id_rsa )、及 ( id_dsa.pub / id_rsa )。&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;我過去有一個錯誤的觀念，以為金鑰是對應系統的，所以在對每一台主機得另外產生一次。&lt;br /&gt;
事實上如果沒有特殊需求，你&lt;em style=&quot;color: #990000; font-style: normal; font-weight: normal;&quot;&gt;可以只用一份、用任一系統產生、並把這一份給保存好即可&lt;/em&gt;。希望大家不要跟我有一樣的錯誤囉！&lt;/div&gt;&lt;h3 style=&quot;font-size: 14px; font-weight: bold; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;步驟 2. 將公開金鑰放到主機&lt;/h3&gt;&lt;div style=&quot;margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;你現在在自己的機器上已經有了三對金鑰，接下來我們要把公開的三隻 (*.pub) 放到我們要登入的主機上。&lt;/div&gt;&lt;code class=&quot;command-line&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #333333; display: block; font-family: Monaco, &#39;Trebuchet MS&#39;, Verdana; font-size: 12px; font-style: normal; font-weight: normal; line-height: 1.5; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 8px; padding-bottom: 8px; padding-left: 8px; padding-right: 8px; padding-top: 8px;&quot;&gt;$ scp ~/.ssh/*.pub&amp;nbsp;&lt;em style=&quot;color: #336699; font-style: normal; font-weight: normal;&quot;&gt;你欲登入的主機&lt;/em&gt;:~/.ssh/.&lt;/code&gt;&lt;div style=&quot;margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;接著登入該系統，在沒設定好之前當然還是得乖乖打密碼&lt;/div&gt;&lt;code class=&quot;command-line&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #333333; display: block; font-family: Monaco, &#39;Trebuchet MS&#39;, Verdana; font-size: 12px; font-style: normal; font-weight: normal; line-height: 1.5; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 8px; padding-bottom: 8px; padding-left: 8px; padding-right: 8px; padding-top: 8px;&quot;&gt;$ ssh&amp;nbsp;&lt;em style=&quot;color: #336699; font-style: normal; font-weight: normal;&quot;&gt;你欲登入的主機&lt;/em&gt;&lt;/code&gt;&lt;div style=&quot;margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;系統預設處理放置公鑰的檔案叫做&amp;nbsp;&lt;em style=&quot;color: #990000; font-style: normal; font-weight: normal;&quot;&gt;authorized_keys&lt;/em&gt;，所以我們要把剛剛所傳的公鑰附加到這個檔案中：&lt;/div&gt;&lt;code class=&quot;command-line&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #333333; display: block; font-family: Monaco, &#39;Trebuchet MS&#39;, Verdana; font-size: 12px; font-style: normal; font-weight: normal; line-height: 1.5; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 8px; padding-bottom: 8px; padding-left: 8px; padding-right: 8px; padding-top: 8px;&quot;&gt;$ cat ~/.ssh/identity.pub &amp;gt;&amp;gt; ~/.ssh/authorized_keys&lt;br /&gt;
$ cat ~/.ssh/id_rsa.pub &amp;gt;&amp;gt; ~/.ssh/authorized_keys&lt;br /&gt;
$ cat ~/.ssh/id_dsa.pub &amp;gt;&amp;gt; ~/.ssh/authorized_keys&lt;br /&gt;
$ chmod 711 ~/.ssh&lt;br /&gt;
$ chmod 644 ~/.ssh/authorized_keys&lt;/code&gt;&lt;div style=&quot;margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;如果沒有意外，你登出再登入主機，就會看到它請你輸入 Passphrase 的訊息。&lt;/div&gt;&lt;h3 style=&quot;font-size: 14px; font-weight: bold; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;步驟 3. 設定 ssh-agent&lt;/h3&gt;&lt;div style=&quot;margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;前面所提到，每次都要打 Passphrase 就太麻煩了，所以這裡要設定管家&amp;nbsp;&lt;em style=&quot;color: #990000; font-style: normal; font-weight: normal;&quot;&gt;ssh-agent&lt;/em&gt;、以保管私鑰及 Passphrase。&lt;br /&gt;
在你每次啟動 shell 後，請照這樣的方式來做：&lt;/div&gt;&lt;h4 style=&quot;font-size: 13px; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;a. 啟動 ssh-agent&lt;/h4&gt;&lt;code class=&quot;command-line&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #333333; display: block; font-family: Monaco, &#39;Trebuchet MS&#39;, Verdana; font-size: 12px; font-style: normal; font-weight: normal; line-height: 1.5; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 8px; padding-bottom: 8px; padding-left: 8px; padding-right: 8px; padding-top: 8px;&quot;&gt;$ eval `ssh-agent -s`&lt;/code&gt;&lt;h4 style=&quot;font-size: 13px; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;b. 將私密金鑰交給 ssh-agent 保管：ssh-add&lt;/h4&gt;&lt;div style=&quot;margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;我們將要用&amp;nbsp;&lt;em style=&quot;color: #990000; font-style: normal; font-weight: normal;&quot;&gt;ssh-add&lt;/em&gt;&amp;nbsp;來指定金鑰，如果你都照上面放預設的位置及相同的檔名，那就不用有任何的參數。&lt;/div&gt;&lt;code class=&quot;command-line&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #333333; display: block; font-family: Monaco, &#39;Trebuchet MS&#39;, Verdana; font-size: 12px; font-style: normal; font-weight: normal; line-height: 1.5; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 8px; padding-bottom: 8px; padding-left: 8px; padding-right: 8px; padding-top: 8px;&quot;&gt;$ ssh-add&lt;/code&gt;&lt;div style=&quot;margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;接著會要求你設定輸入 passphrase，如果三個都一樣，就只要打一次。&lt;/div&gt;&lt;code class=&quot;command-line&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #333333; display: block; font-family: Monaco, &#39;Trebuchet MS&#39;, Verdana; font-size: 12px; font-style: normal; font-weight: normal; line-height: 1.5; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 8px; padding-bottom: 8px; padding-left: 8px; padding-right: 8px; padding-top: 8px;&quot;&gt;Enter passphrase for /home/username/.ssh/id_rsa:&lt;em style=&quot;color: #336699; font-style: normal; font-weight: normal;&quot;&gt;你的 Passphrase&lt;/em&gt;&lt;br /&gt;
Identity added: /home/username/.ssh/id_rsa (/home/username/.ssh/id_rsa)&lt;br /&gt;
Identity added: /home/username/.ssh/id_dsa (/home/username/.ssh/id_dsa)&lt;br /&gt;
Identity added: /home/username/.ssh/identity (username@username.com)&lt;/code&gt;&lt;div style=&quot;margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;接著再試看看登入已經放好公鑰的主機，應該就可以不用密碼登入了！&lt;/div&gt;&lt;h4 style=&quot;font-size: 13px; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;c. 自動化流程&lt;/h4&gt;&lt;div style=&quot;margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;如果每次進 Shell 都要做 a、b 動作，可能還是太麻煩且忘記，也因此我去找了可以放在 .bash_profile 的 script (&amp;nbsp;&lt;cite style=&quot;font-style: normal; font-weight: normal;&quot;&gt;&lt;a href=&quot;http://www.cygwin.com/ml/cygwin/2001-06/msg00537.html&quot; style=&quot;color: #1a66cb; text-decoration: none;&quot;&gt;Joseph M. Reagle Jr&lt;/a&gt;&lt;/cite&gt;&amp;nbsp;)，&lt;br /&gt;
一進入 Shell 就會把該做的動作做好，且詢問你 Passphrase：&lt;code class=&quot;command-line&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; color: #333333; display: block; font-family: Monaco, &#39;Trebuchet MS&#39;, Verdana; font-size: 12px; font-style: normal; font-weight: normal; line-height: 1.5; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 8px; padding-bottom: 8px; padding-left: 8px; padding-right: 8px; padding-top: 8px;&quot;&gt;SH_ENV=&quot;$HOME/.ssh/environment&quot;&lt;br /&gt;
&lt;br /&gt;
function start_agent {&lt;br /&gt;
echo &quot;Initialising new SSH agent...&quot;&lt;br /&gt;
/usr/bin/ssh-agent | sed &#39;s/^echo/#echo/&#39; &amp;gt; &quot;${SSH_ENV}&quot;&lt;br /&gt;
echo succeeded&lt;br /&gt;
chmod 600 &quot;${SSH_ENV}&quot;&lt;br /&gt;
. &quot;${SSH_ENV}&quot; &amp;gt; /dev/lull&lt;br /&gt;
/usr/bin/ssh-add;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# Source SSH settings, if applicable&lt;br /&gt;
&lt;br /&gt;
if [ -f &quot;${SSH_ENV}&quot; ]; then&lt;br /&gt;
. &quot;${SSH_ENV}&quot; &amp;gt; /dev/null&lt;br /&gt;
#ps ${SSH_AGENT_PID} doesn’t work under cywgin&lt;br /&gt;
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ &amp;gt; /dev/null || {&lt;br /&gt;
start_agent;&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
start_agent;&lt;br /&gt;
fi&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;block&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;h2 style=&quot;font-size: 16px; font-weight: bold; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;三、公私鑰所需放的機器&lt;/h2&gt;&lt;div style=&quot;margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;我的歸納是，在&lt;em style=&quot;color: #990000; font-style: normal; font-weight: normal;&quot;&gt;本機&lt;/em&gt;上你必需一直保有這兩份以便&lt;em style=&quot;color: #990000; font-style: normal; font-weight: normal;&quot;&gt;後續的再製&lt;/em&gt;。而公鑰整理成 authorized_keys，以後&lt;em style=&quot;color: #990000; font-style: normal; font-weight: normal;&quot;&gt;有新機器需要登入時一律傳此檔案上去做附加&lt;/em&gt;。&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0.3em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;而除了本機外，那些機器需要放私鑰呢？我的情況是&lt;em style=&quot;color: #990000; font-style: normal; font-weight: normal;&quot;&gt;最常用的那台開發機&lt;/em&gt;，因為你可能會利用他去 SSH 其它台機器。不然的話，應該&lt;em style=&quot;color: #990000; font-style: normal; font-weight: normal;&quot;&gt;減少私鑰的存放地點，以求安全&lt;/em&gt;。&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;block&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;h2 style=&quot;font-size: 16px; font-weight: bold; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;四、延伸閱讀&lt;/h2&gt;&lt;ul style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://static.josephj.com/ico_dot.gif); background-origin: initial; background-position: 0px 0.25em; background-repeat: no-repeat no-repeat; list-style-image: initial; list-style-position: initial; list-style-type: none; margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.5em; padding-bottom: 0px; padding-left: 1em; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;a href=&quot;http://josephjiang.com/article/putty-key/&quot; style=&quot;color: #1a66cb; text-decoration: none;&quot;&gt;實作 PuTTY 的免密碼登入&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iphoneipad-develop.blogspot.com/feeds/8411174302084484051/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/03/ssh.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/8411174302084484051'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/8411174302084484051'/><link rel='alternate' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/03/ssh.html' title='SSH  免密碼登入'/><author><name>Hsin</name><uri>http://www.blogger.com/profile/11673965008839019372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHCbYEown8QoYxImaBJ7gkp4LWmPJHgIS-DE4CfqN0brLrtJHnlue_XikYX52aobHVY_wr8QGlMgbG2myV_0DtZeHMbpJr7GpclQIeYYkdEi_xRmK001m5kf3gG57zxw/s220/1.sLByIvXvAHN'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3644496878787142706.post-3398587532056540026</id><published>2011-03-08T17:19:00.000-08:00</published><updated>2011-03-08T17:36:57.888-08:00</updated><title type='text'>iPad / iPhone 上的 AR 相關應用</title><content type='html'>&lt;h1 id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot; style=&quot;border-collapse: collapse; color: #444444; font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 1.17em; line-height: normal; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; margin-top: 8px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; word-wrap: break-word;&quot;&gt;iPhone上的擴增實境(AR:Augmented Reality)應用&lt;/h1&gt;&lt;br /&gt;
&lt;a href=&quot;http://dev.iphonetw.net/thread-1038-1-1.html&quot;&gt;http://dev.iphonetw.net/thread-1038-1-1.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h2 id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot; style=&quot;font-family: arial, &#39;Century Gothic&#39;; font-size: 12px; font-weight: normal; line-height: 40px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;a href=&quot;http://kocpc.pixnet.net/blog/post/27348620&quot; style=&quot;color: #111111; font-size: 15px; outline-color: initial; outline-style: none; outline-width: initial; text-decoration: none;&quot;&gt;[iPhone]世界首創的AR應用遊戲---ARDefender&lt;/a&gt;&lt;/h2&gt;&lt;br /&gt;
&lt;a href=&quot;http://kocpc.pixnet.net/blog/post/27348620&quot;&gt;http://kocpc.pixnet.net/blog/post/27348620&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3 class=&quot;title&quot; id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Parrot AR.Drone iPhone/iPad 遙控直升機 首度在港發佈&lt;/h3&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.umpcfever.com/news/?postid=3785&quot;&gt;http://www.umpcfever.com/news/?postid=3785&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.youtube.com/watch?v=jc-DX3S_QMw&quot;&gt;http://www.youtube.com/watch?v=jc-DX3S_QMw&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
下面則是非 iPhone / iPad 的 AR 應用&lt;br /&gt;
&lt;a href=&quot;http://taiwan.cnet.com/crave/0,2000088746,20140452,00.htm&quot;&gt;http://taiwan.cnet.com/crave/0,2000088746,20140452,00.htm&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
有點像 seki-camera&lt;br /&gt;
&lt;a href=&quot;http://www.cocoachina.com/iphonedev/sdk/2010/0722/1909.html&quot;&gt;http://www.cocoachina.com/iphonedev/sdk/2010/0722/1909.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AR 結合 T-shirt&lt;br /&gt;
&lt;a href=&quot;http://unwire.hk/2010/01/23/ar-t-shirt-the-stupid-way-to-use/news/&quot;&gt;http://unwire.hk/2010/01/23/ar-t-shirt-the-stupid-way-to-use/news/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
吹泡泡&lt;br /&gt;
&lt;a href=&quot;http://www.iapps.im/archives/17535&quot;&gt;http://www.iapps.im/archives/17535&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://iphoneipad-develop.blogspot.com/feeds/3398587532056540026/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/03/ipad-iphone-ar.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/3398587532056540026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/3398587532056540026'/><link rel='alternate' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/03/ipad-iphone-ar.html' title='iPad / iPhone 上的 AR 相關應用'/><author><name>Hsin</name><uri>http://www.blogger.com/profile/11673965008839019372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHCbYEown8QoYxImaBJ7gkp4LWmPJHgIS-DE4CfqN0brLrtJHnlue_XikYX52aobHVY_wr8QGlMgbG2myV_0DtZeHMbpJr7GpclQIeYYkdEi_xRmK001m5kf3gG57zxw/s220/1.sLByIvXvAHN'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3644496878787142706.post-1365699469928389806</id><published>2011-03-07T17:30:00.001-08:00</published><updated>2011-03-07T17:30:05.652-08:00</updated><title type='text'>apple 動畫功能 ...程式碼範例</title><content type='html'>&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal &#39;Heiti TC Light&#39;; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span id=&quot;&quot; style=&quot;font: normal normal normal 13px/normal Helvetica;&quot;&gt;Apple&amp;nbsp;&lt;/span&gt;提供了流暢的動畫功能給各位開發者，差不多每一個&lt;span style=&quot;font: normal normal normal 13px/normal Helvetica;&quot;&gt;&amp;nbsp;App&amp;nbsp;&lt;/span&gt;都會用到的動畫功能，無需複雜的程式碼便可以輕鬆使用到。&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal &#39;Heiti TC Light&#39;; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;在這裡簡單介紹一下。&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Helvetica; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 16px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal &#39;Heiti TC Light&#39;; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;使用以下的程式碼便可以制作出動畫效果。&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;UIViewAnimationTransition transition = UIViewAnimationTransitionCurlU&lt;wbr&gt;&lt;/wbr&gt;p;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;UIViewAnimationCurve curve = UIViewAnimationCurveEaseInOut;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;[UIView beginAnimations:@&quot;anim&quot; context:NULL];&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;[UIView setAnimationCurve:curve];&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;[UIView setAnimationTransition:&lt;wbr&gt;&lt;/wbr&gt;transition forView:[self view] cache:YES];&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;[UIView setAnimationDuration:1.0f];&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;[UIView commitAnimations];&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Helvetica; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 16px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal &#39;Heiti TC Light&#39;; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;現在雖然有動畫效果，但頁面還是沒有改變，&lt;wbr&gt;&lt;/wbr&gt;例如要新增一個黑色的頁面。&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal &#39;Heiti TC Light&#39;; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;以下程式碼要加到動畫程式碼之前。&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;[view setBackgroundColor:[UIColor blackColor]];&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;[self.view addSubview:view];&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Helvetica; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 16px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal &#39;Heiti TC Light&#39;; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;完整轉頁效果&lt;span style=&quot;font: normal normal normal 13px/normal Helvetica;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;[view setBackgroundColor:[UIColor blackColor]];&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;[self.view addSubview:view];&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 16px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;UIViewAnimationTransition transition = UIViewAnimationTransitionCurlU&lt;wbr&gt;&lt;/wbr&gt;p;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;UIViewAnimationCurve curve = UIViewAnimationCurveEaseInOut;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;[UIView beginAnimations:@&quot;anim&quot; context:NULL];&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;[UIView setAnimationCurve:curve];&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;[UIView setAnimationTransition:&lt;wbr&gt;&lt;/wbr&gt;transition forView:[self view] cache:YES];&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;[UIView setAnimationDuration:1.0f];&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;[UIView commitAnimations];&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;[view release];&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Helvetica; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 16px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal &#39;Heiti TC Light&#39;; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;是否很簡單&lt;span style=&quot;font: normal normal normal 13px/normal Helvetica;&quot;&gt;?&amp;nbsp;&lt;/span&gt;其實&lt;span style=&quot;font: normal normal normal 13px/normal Helvetica;&quot;&gt;&amp;nbsp;Apple&amp;nbsp;&lt;/span&gt;已經提供了四動晝效果和四種速度變化。&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Helvetica; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 16px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal &#39;Heiti TC Light&#39;; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;向上翻頁的效果&lt;span style=&quot;font: normal normal normal 13px/normal Helvetica;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;//Curl Up&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;UIViewAnimationTransition transition = UIViewAnimationTransitionCurlU&lt;wbr&gt;&lt;/wbr&gt;p;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Helvetica; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 16px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal &#39;Heiti TC Light&#39;; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;向下翻頁的效果&lt;span style=&quot;font: normal normal normal 13px/normal Helvetica;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;//Curl Down&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;UIViewAnimationTransition transition = UIViewAnimationTransitionCurlD&lt;wbr&gt;&lt;/wbr&gt;own;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Helvetica; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 16px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal &#39;Heiti TC Light&#39;; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;由左向右旋轉的效果&lt;span style=&quot;font: normal normal normal 13px/normal Helvetica;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;//Flip From Left&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;UIViewAnimationTransition transition = UIViewAnimationTransitionFlipF&lt;wbr&gt;&lt;/wbr&gt;romLeft;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Helvetica; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 16px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal &#39;Heiti TC Light&#39;; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;由右向左旋轉的效果&lt;span style=&quot;font: normal normal normal 13px/normal Helvetica;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;//Flip From Right&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;UIViewAnimationTransition transition = UIViewAnimationTransitionFlipF&lt;wbr&gt;&lt;/wbr&gt;romRight;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Helvetica; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 16px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal &#39;Heiti TC Light&#39;; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;開始時慢慢加速，結束前慢慢減速&lt;span style=&quot;font: normal normal normal 13px/normal Helvetica;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;UIViewAnimationCurve curve = UIViewAnimationCurveEaseInOut;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Helvetica; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 16px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal &#39;Heiti TC Light&#39;; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;開始時慢慢加速&lt;span style=&quot;font: normal normal normal 13px/normal Helvetica;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;UIViewAnimationCurve curve = UIViewAnimationCurveEaseIn;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Helvetica; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 16px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal &#39;Heiti TC Light&#39;; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;結束前慢慢減速&lt;span style=&quot;font: normal normal normal 13px/normal Helvetica;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;UIViewAnimationCurve curve = UIViewAnimationCurveEaseOut;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Helvetica; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 16px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal &#39;Heiti TC Light&#39;; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;開始到尾也是均速&lt;span style=&quot;font: normal normal normal 13px/normal Helvetica;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Courier; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;UIViewAnimationCurve curve = UIViewAnimationCurveLinear;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal Helvetica; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 16px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot; style=&quot;border-collapse: collapse; color: #666666; font-family: arial, sans-serif; font-size: 13px; font: normal normal normal 13px/normal &#39;Heiti TC Light&#39;; line-height: 20px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;大家可以試試那一個效果最適合你的&lt;span style=&quot;font: normal normal normal 13px/normal Helvetica;&quot;&gt;&amp;nbsp;App&lt;/span&gt;。&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iphoneipad-develop.blogspot.com/feeds/1365699469928389806/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/03/apple.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/1365699469928389806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/1365699469928389806'/><link rel='alternate' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/03/apple.html' title='apple 動畫功能 ...程式碼範例'/><author><name>Hsin</name><uri>http://www.blogger.com/profile/11673965008839019372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHCbYEown8QoYxImaBJ7gkp4LWmPJHgIS-DE4CfqN0brLrtJHnlue_XikYX52aobHVY_wr8QGlMgbG2myV_0DtZeHMbpJr7GpclQIeYYkdEi_xRmK001m5kf3gG57zxw/s220/1.sLByIvXvAHN'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3644496878787142706.post-2844457942245873228</id><published>2011-03-03T00:29:00.000-08:00</published><updated>2011-03-07T17:25:32.647-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bookmark"/><title type='text'>宜定期拜訪</title><content type='html'>高兄&lt;br /&gt;
&lt;a href=&quot;http://blog.eddie.com.tw/2010/11/23/iphone-app-in-action/&quot;&gt;http://blog.eddie.com.tw/2010/11/23/iphone-app-in-action/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
icodeblog&lt;br /&gt;
&lt;a href=&quot;http://www.icodeblog.com/category/iphone-programming-tutorials/&quot;&gt;http://www.icodeblog.com/category/iphone-programming-tutorials/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
stanford課程&lt;br /&gt;
&lt;a href=&quot;http://www.stanford.edu/class/cs193p/cgi-bin/drupal/&quot;&gt;http://www.stanford.edu/class/cs193p/cgi-bin/drupal/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
iphonedevelopertips.com&lt;br /&gt;
&lt;a href=&quot;http://iphonedevelopertips.com/open-source/ios-open-source-pulltorefresh.html?utm_source=feedburner&amp;amp;utm_medium=feed&amp;amp;utm_campaign=Feed:+IphoneDeveloperTips+(iOS+Developer+Tips)&quot;&gt;http://iphonedevelopertips.com/open-source/ios-open-source-pulltorefresh.html?utm_source=feedburner&amp;amp;utm_medium=feed&amp;amp;utm_campaign=Feed:+IphoneDeveloperTips+(iOS+Developer+Tips)&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
iphonetw&lt;br /&gt;
&lt;a href=&quot;http://dev.iphonetw.net/forum-6-1.html&quot;&gt;http://dev.iphonetw.net/forum-6-1.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
cocoachina&lt;br /&gt;
&lt;a href=&quot;http://www.cocoachina.com/bbs/read.php?tid-32105.html&quot;&gt;http://www.cocoachina.com/bbs/read.php?tid-32105.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
iphone org hk&lt;br /&gt;
&lt;a href=&quot;http://www.iphone.org.hk/cgi-bin/ch/board_show.cgi?id=11&amp;amp;age=0&amp;amp;pg=1&quot;&gt;http://www.iphone.org.hk/cgi-bin/ch/board_show.cgi?id=11&amp;amp;age=0&amp;amp;pg=1&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
network-programming&lt;br /&gt;
&lt;a href=&quot;http://oreilly.com/iphone/excerpts/iphone-sdk/network-programming.html&quot;&gt;http://oreilly.com/iphone/excerpts/iphone-sdk/network-programming.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
objective-c 2.0&lt;br /&gt;
&lt;a href=&quot;http://shunyuan-chou.blogspot.com/2010/05/objective-c-20-2-objective-c_14.html&quot;&gt;http://shunyuan-chou.blogspot.com/2010/05/objective-c-20-2-objective-c_14.html&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://iphoneipad-develop.blogspot.com/feeds/2844457942245873228/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/03/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/2844457942245873228'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/2844457942245873228'/><link rel='alternate' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/03/blog-post.html' title='宜定期拜訪'/><author><name>Hsin</name><uri>http://www.blogger.com/profile/11673965008839019372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHCbYEown8QoYxImaBJ7gkp4LWmPJHgIS-DE4CfqN0brLrtJHnlue_XikYX52aobHVY_wr8QGlMgbG2myV_0DtZeHMbpJr7GpclQIeYYkdEi_xRmK001m5kf3gG57zxw/s220/1.sLByIvXvAHN'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3644496878787142706.post-8408238791611538634</id><published>2011-03-01T19:34:00.000-08:00</published><updated>2011-03-01T19:34:29.311-08:00</updated><title type='text'>UML -- 使用範例</title><content type='html'>相當不錯，且完整的一個小小 UML 使用範例&lt;br /&gt;
&lt;br /&gt;
請直接連至 網頁 &amp;nbsp;&lt;a href=&quot;http://www.csie.nctu.edu.tw/~skyang/umlsamples.htm&quot;&gt;http://www.csie.nctu.edu.tw/~skyang/umlsamples.htm&lt;/a&gt;&amp;nbsp;&amp;nbsp;觀看&lt;br /&gt;
&lt;br /&gt;
( 為免以後看不到，因此貼於此處，但相關權利屬原作者所有！)&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;一般的遊戲或虛擬實境軟體把描繪好的 3D 畫面呈現在電腦螢幕上， 但一些環場模擬需要呈現多視角的多重顯示，例如賽車模擬可能需要前後左右四個顯示幕， 來表現四個車窗看到的景物，這個時候就需要用到多重顯示(multi-display)系統。 話說到這裡只是個願景(vision)，接下來實際演練如何使用 UML 規劃出這樣的一個軟體系統。&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;&lt;/div&gt;&lt;h2 style=&quot;color: black; font-family: 微軟正黑體, Arial; font-size: 16pt; font-weight: bold;&quot;&gt;第一步、需求分析&lt;/h2&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;所有軟體工程最關鍵的第一步就是需求分析，同時也根據這些需求進行技術可行性分析， 以一個多重顯示系統來講，目的當然是能夠多面同步顯示 3D 場景，此外， 根據應用場合列出以下的需求項目(requirement)。&lt;/span&gt;&lt;h3 style=&quot;color: black; font-family: 微軟正黑體, Arial; font-size: 14pt; font-weight: bold;&quot;&gt;PURPOSE (需求分析)&lt;/h3&gt;&lt;ul style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;&lt;li&gt;目標：多面同步顯示3D場景&lt;/li&gt;
&lt;li&gt;需求：&lt;ol&gt;&lt;li&gt;多面顯示須保證逐畫面同步，否則立體效果(stereo)會失敗。&lt;/li&gt;
&lt;li&gt;多面可顯示不同視角 (viewport)。&lt;/li&gt;
&lt;li&gt;可更換自訂節目，負責描繪各面顯示幕的電腦不需要人為的重新啟動。&lt;/li&gt;
&lt;li&gt;與現有描繪引擎整合，減低應用程式開發負擔。&lt;/li&gt;
&lt;/ol&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;h3 style=&quot;color: black; font-family: 微軟正黑體, Arial; font-size: 14pt; font-weight: bold;&quot;&gt;技術分析&lt;/h3&gt;&lt;ol style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;&lt;li&gt;最直觀的多重顯示系統架構就是主從架構(master/slave)， 有一部 master 端的電腦負責模擬運算， 而每一個顯示幕都由一部 slave 個人電腦負責描繪，master 端與 slave 端之間透過網路纜線直接連結。&lt;/li&gt;

&lt;li&gt;此外，如果把所有的場景資料都由 master 端即時輸送給 slave 端， 除了增加 master 端的負擔以外， 以現今記憶體輸出入速率與網路纜線傳輸速率尚難達成，故選擇在 slave 端磁碟事先放置與 master 端相同的場景資料，執行時期載入並隨時與 master 端同步，以減低資料的傳輸量。&lt;/li&gt;
&lt;/ol&gt;&lt;h2 style=&quot;color: black; font-family: 微軟正黑體, Arial; font-size: 16pt; font-weight: bold;&quot;&gt;第二步、靜態建模&lt;/h2&gt;&lt;h3 style=&quot;color: black; font-family: 微軟正黑體, Arial; font-size: 14pt; font-weight: bold;&quot;&gt;權責劃分&lt;/h3&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;簡明的元件部署在日後的分工、維護、延伸、傳承上都是非常關鍵的因素， 根據需求項目，多重顯示軟體系統分為三個角色。在 slave 端放置一支描繪程式當然無庸置疑，而 master 端的軟體分割為固定的 master 端控制元件，以及可替換的 master 端應用程式， 以因應第三項需求項目：可更換自訂節目。&lt;/span&gt;&lt;div style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;&lt;/div&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;5&quot; id=&quot;table1&quot;&gt;&lt;tbody&gt;
&lt;tr align=&quot;LEFT&quot; bgcolor=&quot;#D0FFD0&quot;&gt;&lt;th&gt;角色(role)&lt;/th&gt;&lt;th&gt;責任(responsibility)&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Slave端描繪程式&lt;/td&gt;&lt;td&gt;接受同步訊息描繪3D場景&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Master 端控制元件&lt;/td&gt;&lt;td&gt;發出視角設定與同步訊號&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Master端應用程式&lt;/td&gt;&lt;td&gt;進行節目流程&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;h3 style=&quot;color: black; font-family: 微軟正黑體, Arial; font-size: 14pt; font-weight: bold;&quot;&gt;部署圖(Depolyment Diagram)&lt;/h3&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;從系統的觀點來看，多重顯示系統是一台 master 主控電腦連接多部 slave 描繪電腦，每一部 slave 電腦可能連接一部投影機，單一組顯示幕的部署圖如下圖， 明確地標示出 slave 端是被 master 端同步的畫面訊號來源。&lt;/span&gt;&lt;div style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;&lt;/div&gt;&lt;center style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://www.csie.nctu.edu.tw/~skyang/figures/multidisplay_deployment.gif&quot; /&gt;&lt;/center&gt;&lt;div style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;&lt;/div&gt;&lt;h3 style=&quot;color: black; font-family: 微軟正黑體, Arial; font-size: 14pt; font-weight: bold;&quot;&gt;元件圖(Component Diagram)&lt;/h3&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;元件圖比部署圖更細節地描述各個節點的構成元素，其中 master 端的應用程式是個主動類別，持有控制元件的 dll handle 和主要的 camera 設定， 而 master 端的控制元件根據應用程式的主要 camera 產生各面顯示幕的 camera 設定， slave 端的描繪程式也是個主動類別，持有場景資料，根據接收而得的 camera 設定和同步訊號描繪畫面。&lt;/span&gt;&lt;div style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;&lt;/div&gt;&lt;center id=&quot;&quot; style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://www.csie.nctu.edu.tw/~skyang/figures/multidisplay_components.gif&quot; /&gt;&lt;/center&gt;&lt;div style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;&lt;/div&gt;&lt;h3 style=&quot;color: black; font-family: 微軟正黑體, Arial; font-size: 14pt; font-weight: bold;&quot;&gt;類別圖(Class Diagram)&lt;/h3&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;最細節的類別圖出爐，就可以開始寫程式了，為了需求項目第四項：與現有描繪引擎整合， 所以 master 端的控制元件類別 RACaveRenderer 衍生自描繪引擎的場景描繪類別 RAGraphRenderer，如下圖所示，這個類別儲存主要 camera 設定，持有各 slave 的設定(configuration)和上下傳連線。它的操作有啟用(enable)多重顯示、 描繪畫面(render)、停用(disable)多重顯示。&lt;/span&gt;&lt;div style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;&lt;/div&gt;&lt;center style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://www.csie.nctu.edu.tw/~skyang/figures/multidisplay_classes.gif&quot; /&gt;&lt;/center&gt;&lt;div style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;&lt;span style=&quot;color: grey; font-size: xx-small;&quot;&gt;附註：工研院亦專門為此目的開發了 2D/3D 多重顯示系統， 尚且加入了許多加速與模組擴充功能，其軟體架構不只如本文所描述的這麼單純。&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;&lt;/div&gt;&lt;h2 style=&quot;color: black; font-family: 微軟正黑體, Arial; font-size: 16pt; font-weight: bold;&quot;&gt;第三步、動態建模&lt;/h2&gt;&lt;h3 style=&quot;color: black; font-family: 微軟正黑體, Arial; font-size: 14pt; font-weight: bold;&quot;&gt;合作圖(Collaboration Diagram)&lt;/h3&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;到此已規劃了多重顯示系統中的各個角色，以及它們不同細節程度的架構描述和權責劃分， 接下來要描述他們是如何動作的。在下圖方格中為各結構體產生的物件實體命名以利分辨， 也可以不命名(例如圖中的應用程式)。沿著圖中訊息的序號，很明白地能夠了解到， 當應用程式呼叫了控制元件 r 的 Render()，控制元件 r 先對 slave 端 s 傳送更新端場景的資料，然後對 s 下達描繪指令。s 描繪完成以後回覆 acknowledgement，然後 r 對 s 下達換畫面的指令、完成一次描繪流程。&lt;/span&gt;&lt;div style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;&lt;/div&gt;&lt;center style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://www.csie.nctu.edu.tw/~skyang/figures/multidisplay_collaboration.gif&quot; /&gt;&lt;/center&gt;&lt;div style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;&lt;/div&gt;&lt;h3 style=&quot;color: black; font-family: 微軟正黑體, Arial; font-size: 14pt; font-weight: bold;&quot;&gt;順序圖(Sequence Diagram)&lt;/h3&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;在合作圖當中可以描述這三個物件實體的訊息交流， 但是無法描述它們動態生成的因果關係，下面的順序圖把這三個實體橫向排開， 在縱向的時間軸上標註他們的生命週期， 並在時間軸上呈現訊息產生的時間而不只是序號而已。由圖上可以看到， Slave 端描繪程式 s 是先啟動的，接著應用程式啟動了，並由應用程式喚醒控制元件 r， 然後連線、載入場景、描繪畫面。而停用多重顯示的時候，首先 r 與 s 斷線， 然後 r 消滅了、應用程式中止，描繪程式 s 繼續等待著與下一個應用程式連線。&lt;/span&gt;&lt;div style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;&lt;/div&gt;&lt;center style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://www.csie.nctu.edu.tw/~skyang/figures/multidisplay_sequence.gif&quot; /&gt;&lt;/center&gt;&lt;div style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;&lt;/div&gt;&lt;h3 style=&quot;color: black; font-family: 微軟正黑體, Arial; font-size: 14pt; font-weight: bold;&quot;&gt;狀態圖(State-Chart Diagram)&lt;/h3&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;把 slave 端的描繪程式下圖分成三個狀態來舉例，收到來自 master 端控制元件的不同訊息，導致它在這三個狀態間跳躍，其實這就是很單純的有限狀態機 (finite state machine)描述法，不需贅述。此外，活動圖(activity diagram)就是眾人皆知的流程圖(flow chart)，在此也不再舉例。&lt;/span&gt;&lt;div style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;&lt;/div&gt;&lt;center style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://www.csie.nctu.edu.tw/~skyang/figures/slave_states.gif&quot; /&gt;&lt;/center&gt;&lt;div class=&quot;bar_gray&quot; style=&quot;background-image: url(http://www.csie.nctu.edu.tw/~skyang/figures/graybar.png); color: black; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 12pt; font-weight: bold; height: 34px; padding-top: 5px; text-indent: 5px; width: 300px;&quot;&gt;五、以 UML 為基礎的軟體開發流程&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;UML 圖形和軟體工程之間的關係，就像藍圖和建設工程之間的關係， 把工程粗略地分成設計、實作、驗證三個階段， 這三個階段可能承辦者都是彼此不相識的不同人員， 如下圖，在設計階段產出 UML 圖形以後，負責實作的人便按圖施工， 如果在實作當中發現問題，便回到 UML 圖形上檢討原設計， 更正圖形之後再繼續按圖施工。而實作完成以後，品質管制人員依照 UML 圖形所描述的架構規格和行為，驗證實作是否正確。 在這設計、實作、到驗證完成的期間就算有人員替換，也不會有問題。&lt;/span&gt;&lt;div style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;&lt;/div&gt;&lt;center style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://www.csie.nctu.edu.tw/~skyang/figures/software_process.gif&quot; /&gt;&lt;/center&gt;&lt;div style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;懂 UML 圖例不等於會畫 UML 圖，就像不是每個會用 PowerPoint 的人都能做出陳述清晰明確的投影片。UML 不是萬靈丹， 先天不佳的設計或不健康的軟體工程流程，並不會因為使用了 UML 就變良好，最關鍵的仍是從團隊領導者到所有組員對軟體工程的共識， 並一再琢磨自身的塑模觀念與技巧。&lt;/div&gt;&lt;div id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot; style=&quot;color: #333333; font-family: 微軟正黑體, &#39;Microsoft Sans Serif&#39;; font-size: 13px;&quot;&gt;在畫 UML 圖的時候，不要老想要把所有的東西塞在同一張圖面上，以免模糊焦點， 寧願分門別類、提綱挈領地多分成幾張圖，這時候善用子系統(或套件)圖示就很重要了。 有許多繪製 UML 圖形的商用軟體兼有管理甚至產生原始程式碼的功能， 筆者奉勸一句：那些功能可以使用但是不能依賴， 程式碼的穩健化和最佳化基本功還是要練習的， 原始程式碼就算是半自動產生的，還是要一行一行自己看過才能校調到最佳狀況。&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iphoneipad-develop.blogspot.com/feeds/8408238791611538634/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/03/uml.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/8408238791611538634'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/8408238791611538634'/><link rel='alternate' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/03/uml.html' title='UML -- 使用範例'/><author><name>Hsin</name><uri>http://www.blogger.com/profile/11673965008839019372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHCbYEown8QoYxImaBJ7gkp4LWmPJHgIS-DE4CfqN0brLrtJHnlue_XikYX52aobHVY_wr8QGlMgbG2myV_0DtZeHMbpJr7GpclQIeYYkdEi_xRmK001m5kf3gG57zxw/s220/1.sLByIvXvAHN'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3644496878787142706.post-2255347167055611636</id><published>2011-03-01T09:15:00.000-08:00</published><updated>2011-03-01T09:15:27.289-08:00</updated><title type='text'>uikit overview and send email</title><content type='html'>&lt;a href=&quot;http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CocoaFundamentals/Art/uikit_classes.jpg&quot;&gt;http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CocoaFundamentals/Art/uikit_classes.jpg&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
detect touch event on imageview&lt;br /&gt;
&lt;a href=&quot;http://stackoverflow.com/questions/855095/how-can-i-detect-the-touch-event-of-an-uiimageview&quot;&gt;http://stackoverflow.com/questions/855095/how-can-i-detect-the-touch-event-of-an-uiimageview&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
openurl to send email from APP&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.icodeblog.com/2009/02/20/iphone-programming-tutorial-using-openurl-to-send-email-from-your-app/&quot;&gt;http://www.icodeblog.com/2009/02/20/iphone-programming-tutorial-using-openurl-to-send-email-from-your-app/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
with attachement&lt;br /&gt;
&lt;a href=&quot;http://howtomakeiphoneapps.com/2009/07/how-to-make-your-iphone-app-send-email-with-attachments/&quot;&gt;http://howtomakeiphoneapps.com/2009/07/how-to-make-your-iphone-app-send-email-with-attachments/&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://iphoneipad-develop.blogspot.com/feeds/2255347167055611636/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/03/uikit-overview-and-send-email.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/2255347167055611636'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/2255347167055611636'/><link rel='alternate' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/03/uikit-overview-and-send-email.html' title='uikit overview and send email'/><author><name>Hsin</name><uri>http://www.blogger.com/profile/11673965008839019372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHCbYEown8QoYxImaBJ7gkp4LWmPJHgIS-DE4CfqN0brLrtJHnlue_XikYX52aobHVY_wr8QGlMgbG2myV_0DtZeHMbpJr7GpclQIeYYkdEi_xRmK001m5kf3gG57zxw/s220/1.sLByIvXvAHN'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3644496878787142706.post-512405566020201245</id><published>2011-02-28T21:55:00.001-08:00</published><updated>2011-02-28T21:55:50.261-08:00</updated><title type='text'>git branch</title><content type='html'>&lt;div class=&quot;entry-meta&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #888888; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, &#39;Nimbus Sans L&#39;, sans-serif; font-size: 12px; line-height: 24px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;全文請至以下網址閱讀&lt;/div&gt;&lt;div class=&quot;entry-meta&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #888888; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, &#39;Nimbus Sans L&#39;, sans-serif; font-size: 12px; line-height: 24px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;meta-prep meta-prep-author&quot; id=&quot;&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;a href=&quot;http://ihower.tw/blog/archives/2620&quot;&gt;http://ihower.tw/blog/archives/2620&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;entry-meta&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #888888; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, &#39;Nimbus Sans L&#39;, sans-serif; font-size: 12px; line-height: 24px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;meta-prep meta-prep-author&quot; id=&quot;&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Posted on&lt;/span&gt;&amp;nbsp;&lt;a href=&quot;http://ihower.tw/blog/archives/2620&quot; rel=&quot;bookmark&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #888888; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot; title=&quot;10:23 pm&quot;&gt;&lt;span class=&quot;entry-date&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;April 24, 2009&lt;/span&gt;&lt;/a&gt;&amp;nbsp;&lt;span class=&quot;meta-sep&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;by&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;author vcard&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;a class=&quot;url fn n&quot; href=&quot;http://ihower.tw/blog/archives/author/hower&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #888888; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot; title=&quot;View all posts by ihower&quot;&gt;ihower&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;entry-content&quot; id=&quot;&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; color: #333333; font-family: Georgia, &#39;Bitstream Charter&#39;, serif; font-size: 16px; line-height: 24px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 12px; vertical-align: baseline;&quot;&gt;&lt;div id=&quot;&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 24px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;後記：寫一寫覺得這個系列對初學者可能不太容易了解… XD 要寫出簡單易懂的說明還真是需要花點功夫，想想拖稿太久還是作罷。&lt;/div&gt;&lt;div id=&quot;&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 24px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;用 Git 就是要愛用 Branch 啊，Branch 很好用，開 Branch 不用錢。開 Branch 的情境除了在上一篇中提到因應產品 release 需求的 stable/production branch 之外，其他開 branch 情況有：&lt;/div&gt;&lt;ul style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; list-style-image: initial; list-style-position: initial; list-style-type: square; margin-bottom: 24px; margin-left: 1.5em; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;帶有實驗性質的變更，例如想改寫新的演算法、重構程式碼等&lt;/li&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;新功能 feature 開發&lt;/li&gt;
&lt;li id=&quot;&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Bug fixes，你可能需要做些實驗才知道到底怎麼修&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 24px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;這些事情都可以先在本地開 local branch 做，而不需要立即 Push 分享給別人。&lt;/div&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 24px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Monaco, Consolas, &#39;Andale Mono&#39;, &#39;DejaVu Sans Mono&#39;, monospace; font-size: 13px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;
git branch &amp;lt;new_branch_name&amp;gt; 建立本地 local branch&lt;br /&gt;
git branch -m &amp;lt;old_name&amp;gt; &amp;lt;new_name&amp;gt; 改名字 (如果有同名會失敗，改用 -M 可以強制覆蓋)&lt;br /&gt;
git branch 列出目前有那些 branch 以及目前在那個 branch&lt;br /&gt;
git checkout &amp;lt;branch_name&amp;gt; 切換 branch (注意到如果你有檔案修改了卻還沒 commit，會不能切換 branch，解法稍後會談)&lt;br /&gt;
git checkout -b &amp;lt;new_branch_name&amp;gt; (&amp;lt;from_branch_name&amp;gt;) 本地建立 branch 並立即 checkout 切換過去&lt;br /&gt;
git branch -d &amp;lt;branch_name&amp;gt; 刪除 local branch&lt;/code&gt;&lt;/div&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 24px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;開 Branch 最大的好處除了可以不影響 stable 和其他分支版本的開發，另一個超棒的地方是”你可以決定 Merge 的方式”。Git 的 Merge 方式可以分成四種：&lt;/div&gt;&lt;ul style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; list-style-image: initial; list-style-position: initial; list-style-type: square; margin-bottom: 24px; margin-left: 1.5em; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Straight merge 預設的合併模式，會有全部的被合併的 branch commits 記錄加上一個 merge-commit，看線圖會有兩條 Parents 線，並保留所有 commit log。&lt;/li&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Squashed commit 壓縮成只有一個 merge-commit，不會有被合併的 log。SVN 的 merge 即是如此。&lt;/li&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;cherry-pick 只合併指定的 commit&lt;/li&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;rebase 變更 branch 的分支點：找到要合併的兩個 branch 的共同的祖先，然後先只用要被 merge 的 branch 來 commit 一遍，然後再用目前 branch 再 commit 上去。這方式僅適合還沒分享給別人的 local branch，因為等於砍掉重練 commit log。&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 24px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;其中 rebase 比較難理解會在下一篇再詳述：&lt;/div&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 24px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Monaco, Consolas, &#39;Andale Mono&#39;, &#39;DejaVu Sans Mono&#39;, monospace; font-size: 13px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;
git merge &amp;lt;branch_name&amp;gt; 合併另一個 branch，若沒有 conflict 衝突會直接 commit。若需要解決衝突則會再多一個 commit。&lt;br /&gt;
git merge --squash &amp;lt;branch_name&amp;gt; 將另一個 branch 的 commit 合併為一筆，特別適合需要做實驗的 fixes bug 或 new feature，最後只留結果。合併完不會幫你先 commit。&lt;br /&gt;
git cherry-pick 321d76f 只合併特定其中一個 commit。如果要合併多個，可以加上 -n 指令就不會先幫你 commit，這樣可以多 pick幾個要合併的 commit，最後再 git commit 即可。&lt;/code&gt;&lt;/div&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 24px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;使用 merge 可能會有部分程式碼會 conflict 衝突：簡單的情況只要編輯檔案處理 &amp;lt;&amp;lt;&amp;lt;&amp;lt; ===== &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 即可，然後重新 add 到 staging area 並 commit (沒有像 SVN 的 resolve 指令)。複雜一點的可以再用 git mergetool 選檔案合併的 GUI 工具 (OS X 下面可以用 opendiff, linux 可以用 kdiff3 )，處理好後 git commit。&lt;/div&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 24px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;一旦 merge 好了，git branch -d &amp;lt;branch_name&amp;gt; 可以刪除 branch。但如果要刪除的 branch 還沒有合併，就會有錯誤訊息。如果真的要強制刪除可以用 -D&lt;/div&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 24px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Git 的 working tree 是從 SVN 換過來一個不習慣的地方，因為它只是一個工作暫存區，在切換 Branch 時就會整個換掉。也因為如此，&lt;strong style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;如果有檔案有修改還沒有 commit 出去，切換 branch 時就會出現 error 不能切換&lt;/strong&gt;&amp;nbsp;(除非是新的 untracking 檔案)，例如有修改還沒 add 會出現 error: Entry ‘ooxx’ not uptodate. Cannot merge. 有修改且已經add(還沒ci)會出現 error: Entry ‘ooxx’ would be overwritten by merge. Cannot merge.&lt;/div&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 24px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;最理想的處理當然是事情剛好做到一個段落，把東西 commit 出去才切換 branch 做事。不過事情總有臨時，如果要換 branch 的暫時的解決方式是使用 git stash 會先把修改暫存下來，要回復則執行 git stash pop。下一篇等你學會 git reset 之後，你會發現就算把還沒完成的東西 commit 也不會怎麼樣，只要還沒 push 出去一切 commit 紀錄都是可以改的。&lt;/div&gt;&lt;h3 style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; color: black; font-weight: normal; line-height: 1.5em; margin-bottom: 20px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Remote repo. 操作&lt;/h3&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 24px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;首先要認識的是 Protocol，像在 Github 上面看自己的 Project，會有分 Public Clone URL 跟 Your Clone URL，這有什麼差?&lt;/div&gt;&lt;ul style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; list-style-image: initial; list-style-position: initial; list-style-type: square; margin-bottom: 24px; margin-left: 1.5em; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;git://github.com/ihower/project.git 這種的是使用 Git 自己的 prototol，優點是速度快，但是沒有認證機制，只適合 read only (port:9418)&lt;/li&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;git@github.com/ihower/project.git 這種的是使用 SSH，可以有認證(SSH key)&lt;/li&gt;
&lt;li style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;Git 也可以透過 HTTPS 的方式，不過速度較慢，比較適合對 firewall 有限制的情況&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 24px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;其中 Github 就是同時用 SSH + Git protocol，兼顧認證需求及速度。&lt;/div&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 24px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Monaco, Consolas, &#39;Andale Mono&#39;, &#39;DejaVu Sans Mono&#39;, monospace; font-size: 13px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;
git clone &amp;lt;remote_address&amp;gt;&lt;br /&gt;
git checkout --track -b foobar origin/foobar 將遠端的 branch checkout 回來並建立一個新的 local branch，加上 --track 表示你之後還要pull、push回去，所以請 Git 記住對應關係。&lt;br /&gt;
git pull (&amp;lt;local_branch_name&amp;gt; origin/&amp;lt;remote_branch_name&amp;gt;) 去遠端 fetch 新版並 merge 進 local branch&lt;br /&gt;
git push 將 local branch 的 commit 紀錄更新到遠端&lt;/code&gt;&lt;/div&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Monaco, Consolas, &#39;Andale Mono&#39;, &#39;DejaVu Sans Mono&#39;, monospace; font-size: 13px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;/code&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 24px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Monaco, Consolas, &#39;Andale Mono&#39;, &#39;DejaVu Sans Mono&#39;, monospace; font-size: 13px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;/code&gt;&lt;/div&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 24px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;git pull 要注意的是，如果別人在你上次 pull 之後有 push 新東西上去(也就是說跟你的 branch 產生分岔了)，此時有兩種情況： 一是 Git 可以順利 auto merge 的話，git 會自動多一次 merge commit，這也就為什麼常常 log 會跑出 Merge branch ‘master’ of git@foobar.com。二是如果有 conflict，這時候就需要你手動處理然後 commit。話說如果覺得這種 local branch 和 remote branch 的 merge commit log 很煩，建議可以改使用 git pull –rebase 指令來變成 fast-forward 形式 (就會變得像 svn up，而不會有 merge commit log)。rebase 的意思可能要下一篇才會詳細說明的清楚，簡單的說(?)，就是先砍掉 local branch 分岔點之後自己的 commit，然後把遠端的 commit 先一個個 apply 進來，最後再把自己的 commit 再 apply 進去 (如果有 conflict 會中途停下來，等你修好才會繼續 apply)，如此一來看線圖就會變成一條線而已，也就沒有所謂 merge 這個動作了。&lt;/div&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 24px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;git push 預設的遠端是 origin，並且會將所有有和 remote 有對應的 local branch 都 push 上去。如果要把新的 local branch push 上去，需要下 git push origin &amp;lt;local_vranch_name&amp;gt; 指令。&lt;/div&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 24px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;git push 也可能會失敗，例如出現 ! [rejected] master -&amp;gt; master (non-fast forward)，這個 non-fast forward 的意思是你的 parent commit 和遠端的不相同，也就是線圖有分岔，需要先 pull 回來處理好 merge 才能 push 上去。&lt;/div&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 24px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;fast-forward 在 Git 是一種 merge 術語，當 B branch (例如一個 local branch) 是從 A branch (例如一個 remote branch) 的最新版(HEAD)分支出來的，那當 A 要把 B merge 進來時，因為 B 的 parent commit 是 A 的 HEAD，所以這兩個 branch 唯一的差異就是 B 後來的 commit 而已，而不會有任何 conflict。所以實際上的動作只要把 A 的 HEAD 改成 B 的 HEAD 就好了，線圖上這兩個 branch 根本是同一條線，此謂 fast-forward。&lt;/div&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 24px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;其他操作還有:&lt;/div&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 24px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Monaco, Consolas, &#39;Andale Mono&#39;, &#39;DejaVu Sans Mono&#39;, monospace; font-size: 13px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;
git fetch 把遠端的 branch 更新下載回來，但不會 merge 到 local branch&lt;br /&gt;
git branch -r 顯示 local 有追蹤的遠端 branch。注意到你不能直接修改這個 remote branch，一定要用一個 local branch 對應它。&lt;br /&gt;
git remote show origin 顯示遠端 server 的 branch&lt;br /&gt;
git remote add foobar git:// 可以新增別的 repo. 位置，於是 pull 的時候就可以指定要從哪一個遠端更新回來。&lt;br /&gt;
git push origin :foobar 刪除遠端的 branch&lt;/code&gt;&lt;/div&gt;&lt;div id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 24px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;因為遠端的操作指令比較雜，所以也有人寫了&amp;nbsp;&lt;a href=&quot;http://github.com/webmat/git_remote_branch/tree/master&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #0066cc; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;git_remote_branch&lt;/a&gt;&amp;nbsp;來簡化操作。&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iphoneipad-develop.blogspot.com/feeds/512405566020201245/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/02/git-branch.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/512405566020201245'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/512405566020201245'/><link rel='alternate' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/02/git-branch.html' title='git branch'/><author><name>Hsin</name><uri>http://www.blogger.com/profile/11673965008839019372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHCbYEown8QoYxImaBJ7gkp4LWmPJHgIS-DE4CfqN0brLrtJHnlue_XikYX52aobHVY_wr8QGlMgbG2myV_0DtZeHMbpJr7GpclQIeYYkdEi_xRmK001m5kf3gG57zxw/s220/1.sLByIvXvAHN'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3644496878787142706.post-7964689276267160799</id><published>2011-02-28T09:10:00.001-08:00</published><updated>2011-02-28T09:11:44.920-08:00</updated><title type='text'>Using git for collaboration</title><content type='html'>go to the link&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html&quot;&gt;http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
To see&lt;br /&gt;
using git for collaboration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pull command&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: serif;&quot;&gt;The &quot;pull&quot; command thus performs two operations: it fetches changes from a remote branch, then merges them into the current branch.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://iphoneipad-develop.blogspot.com/feeds/7964689276267160799/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/02/using-git-for-collaboration.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/7964689276267160799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/7964689276267160799'/><link rel='alternate' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/02/using-git-for-collaboration.html' title='Using git for collaboration'/><author><name>Hsin</name><uri>http://www.blogger.com/profile/11673965008839019372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHCbYEown8QoYxImaBJ7gkp4LWmPJHgIS-DE4CfqN0brLrtJHnlue_XikYX52aobHVY_wr8QGlMgbG2myV_0DtZeHMbpJr7GpclQIeYYkdEi_xRmK001m5kf3gG57zxw/s220/1.sLByIvXvAHN'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3644496878787142706.post-4004671697482083888</id><published>2011-02-24T00:47:00.001-08:00</published><updated>2011-02-24T01:01:18.279-08:00</updated><title type='text'>iOS-programming_question</title><content type='html'>1). Iphone 開發方式?&lt;br /&gt;
XCode , 搭配 Git&lt;br /&gt;
2). Iphone 如何與網路溝通? 實例?&lt;br /&gt;
httprequest ?&lt;br /&gt;
http://developer.apple.com/library/ios/#documentation/Networking/Conceptual/CFNetwork/CFHTTPTasks/CFHTTPTasks.html&lt;br /&gt;
CFNetwork Concepts&lt;br /&gt;
http://developer.apple.com/library/ios/#documentation/Networking/Conceptual/CFNetwork/Concepts/Concepts.html#//apple_ref/doc/uid/TP30001132-CH4-DontLinkElementID_13&lt;br /&gt;
&lt;br /&gt;
3). Iphone 如何取得網站上的資料, 並進行解析?&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;. XML 如何進行交換, 實例?&lt;br /&gt;
http://developer.apple.com/library/ios/#samplecode/SeismicXML/Introduction/Intro.html &amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;. 如何將網站上的資料和圖片下載至手機裡, 以供使用?&lt;br /&gt;
Working with Streams&lt;br /&gt;
http://developer.apple.com/library/ios/#documentation/Networking/Conceptual/CFNetwork/CFStreamTasks/CFStreamTasks.html#//apple_ref/doc/uid/TP30000230-61466&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;. 如何將手機上的圖片上傳至網站裡?&lt;br /&gt;
&lt;br /&gt;
4). SQLite 如何應用實做? 如何將交換(XML)所得資料寫入 SQLite?&lt;br /&gt;
&lt;a href=&quot;http://iphoneipad-develop.blogspot.com/2011/02/using-sqlite.html&quot;&gt;http://iphoneipad-develop.blogspot.com/2011/02/using-sqlite.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
5). Iphone, Ipad 的開發方式有何不同? 我該如何著手開發 Ipad?&lt;br /&gt;
6). 帶領我和榆翔實作一個小的 Project, 例如：產品資訊(含圖片)下載 Demo App.&lt;br /&gt;
7). 量 GG App 的實做是否可能?&lt;br /&gt;
8). 如何撰寫 Iphone 開發文件?&lt;br /&gt;
9). Object-C 如何使用 base64 編碼?&lt;br /&gt;
10). 委派的實作與原理&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;i&gt;&lt;b&gt;A:&amp;nbsp;&lt;/b&gt;&lt;/i&gt;請delegate幫我摘水果&lt;/div&gt;&lt;div style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;b&gt;&lt;i&gt;A:&amp;nbsp;&lt;/i&gt;&lt;/b&gt;要當我的delegate必須遵守我的protocol 也就是會爬樹&lt;/div&gt;&lt;div style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;b&gt;&lt;i&gt;B:&lt;/i&gt;&lt;/b&gt;&amp;nbsp;我來當A的delegate&lt;/div&gt;&lt;div style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;b&gt;&lt;i&gt;Compiler:&lt;/i&gt;&lt;/b&gt;&amp;nbsp;B你有遵守protocol嗎&lt;/div&gt;&lt;div style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;b&gt;&lt;i&gt;B:&lt;/i&gt;&lt;/b&gt;&amp;nbsp;有 我會爬樹&lt;/div&gt;&lt;div style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;b&gt;&lt;i&gt;B to A:&lt;/i&gt;&lt;/b&gt;&amp;nbsp;我摘到水果了 請吃&lt;/div&gt;&lt;div style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;b&gt;&lt;i&gt;C:&lt;/i&gt;&lt;/b&gt;&amp;nbsp;我也要當A的delegate&lt;/div&gt;&lt;div style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;b&gt;&lt;i&gt;Compiler:&lt;/i&gt;&lt;/b&gt;&amp;nbsp;C你有遵守protocol嗎&lt;/div&gt;&lt;div style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;b&gt;&lt;i&gt;C:&lt;/i&gt;&lt;/b&gt;&amp;nbsp;沒有 我不會爬樹&lt;/div&gt;&lt;div id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot; style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;b&gt;&lt;i&gt;Compiler&lt;/i&gt;&lt;/b&gt;: 那C你會害我們crash&lt;/div&gt;&lt;div id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot; style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px;&quot;&gt;&lt;div id=&quot;&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; font-size: 14px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;Basically, delegation is a way of allowing objects to interact with each other without creating strong interdependencies between them, since this makes the design of your application less flexible. Instead of objects controlling one another, they can have a delegate which they send (or delegate) messages to, and the delegate does whatever they do, in order to respond and act to this message, and then usually return something back to the other object.&lt;/div&gt;&lt;div id=&quot;&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; font-size: 14px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;Delegation is also a better alternative to subclassing. Instead of you having to create your own custom classes to slightly alter the way that other objects behave, or pass them data, delegation allows objects to send messages to their delegates to do work for them without the overhead of creating subclasses to make minor changes to other objects.&lt;/div&gt;&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; font-size: 14px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;Of course, the main disadvantage of delegation is that the delegate methods available are dependent on what the Apple engineers foresee as being useful and what common implementations they expect people to need, which imposes a restriction on what you can achieve. Although, as Quinn Taylor pointed out, this is specific to the Cocoa frameworks and so doesn&#39;t apply in all situations.&lt;/div&gt;&lt;div id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; font-size: 14px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;If delegation is an option over subclassing, then take it, because it&#39;s a much cleaner way to manage your code and interactions between objects.&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
11). Object-C 如何判斷變數型態? ( C++ 是 typeof ) -&amp;gt; &amp;nbsp;(instanceof) ?&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px;&quot;&gt;Try&amp;nbsp;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 1px; padding-left: 5px; padding-right: 5px; padding-top: 1px; vertical-align: baseline;&quot;&gt;[myObject class]&lt;/code&gt;&amp;nbsp;for returning the class of an object.&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;lang-c prettyprint&quot; id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-height: 600px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;myObject isKindOfClass&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;:[&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;NSString&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: darkblue; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;]]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;lang-c prettyprint&quot; id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-height: 600px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; white-space: normal;&quot;&gt;&lt;pre class=&quot;lang-c prettyprint&quot; id=&quot;aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-height: 600px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; vertical-align: baseline; width: auto;&quot;&gt;&lt;code style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;myObject isKindOfClass&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;:[&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;UIImageView&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: darkblue; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;]]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
12). 如何設計一支 APP, 能在網頁上直接點圖下載? 或是點了圖後, 會出現是否下載的對話框?&lt;br /&gt;
13). Xcode 裡選擇開發型態的差別：什麼時候該用 application based on windows? ... 什麼是時候該 ...&lt;br /&gt;
&lt;br /&gt;
14). 如何在 Object-C 裡使用 base64 或其他編碼, 進行編解碼 ?&lt;br /&gt;
&lt;br /&gt;
15). Open GL 如何使用? or 2D 繪圖?&lt;br /&gt;
&lt;a href=&quot;http://www.discuss.com.hk/archiver/?tid-12945915.html&quot;&gt;http://www.discuss.com.hk/archiver/?tid-12945915.html&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://iphoneipad-develop.blogspot.com/feeds/4004671697482083888/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/02/ios-programmingquestion.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/4004671697482083888'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/4004671697482083888'/><link rel='alternate' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/02/ios-programmingquestion.html' title='iOS-programming_question'/><author><name>Hsin</name><uri>http://www.blogger.com/profile/11673965008839019372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHCbYEown8QoYxImaBJ7gkp4LWmPJHgIS-DE4CfqN0brLrtJHnlue_XikYX52aobHVY_wr8QGlMgbG2myV_0DtZeHMbpJr7GpclQIeYYkdEi_xRmK001m5kf3gG57zxw/s220/1.sLByIvXvAHN'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3644496878787142706.post-2046866532215970042</id><published>2011-02-24T00:39:00.000-08:00</published><updated>2011-02-24T00:39:24.964-08:00</updated><title type='text'>Using SQLite</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #666666; font-family: Helvetica, Arial, Verdana; font-size: 13px; line-height: 20px;&quot;&gt;&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;iPhone&lt;/b&gt;&amp;nbsp;上的應用程式可以使用&amp;nbsp;&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Plist&lt;/b&gt;&amp;nbsp;或&amp;nbsp;&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;XML&lt;/b&gt;&amp;nbsp;檔案去記錄資料，如果資料類型比較簡單，資料和資料之間沒有關聯性，資料數量不多，使用&amp;nbsp;&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Plist&lt;/b&gt;&amp;nbsp;或&amp;nbsp;&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;XML&lt;/b&gt;&amp;nbsp;檔案已經足夠應付。如果需要記錄大量並擁複雜關聯性的資料時，還是建議使用資料庫去去儲存資料好。&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;iPhone&lt;/b&gt;&amp;nbsp;的應用程式可以使用&amp;nbsp;&lt;a href=&quot;http://www.sqlite.org/&quot; style=&quot;background-color: transparent; border-width: 0px; color: #6666ff; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; text-decoration: underline; vertical-align: baseline;&quot;&gt;SQLite&lt;/a&gt;&amp;nbsp;去作為資料庫系統，&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SQLite&lt;/b&gt;&amp;nbsp;是超輕量版的一款資料庫系統，完全不像常用的資料庫系統，例如: MySQL，PostgreSQL，Oracle 等等。&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SQLite&lt;/b&gt;&amp;nbsp;不用安裝，整個資料庫就是以一個檔案的型式存在，存取資料靠&amp;nbsp;&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;iPhone SDK&lt;/b&gt;&amp;nbsp;提供的&amp;nbsp;&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Library&lt;/b&gt;&amp;nbsp;就可以了。由於&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;iPhone SDK&lt;/b&gt;&amp;nbsp;已經內置了&amp;nbsp;&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SQLite&lt;/b&gt;&amp;nbsp;的&amp;nbsp;&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Library&lt;/b&gt;&amp;nbsp;檔案，所以不用擔心兼容性的問題，就算是遲些出到&amp;nbsp;&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;iPhone 5, 6, 7&lt;/b&gt;&amp;nbsp;也沒問題的。操作方面和常用的資料庫系統差不多，一樣可以使用&amp;nbsp;&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SQL&lt;/b&gt;&amp;nbsp;去操作。&lt;br /&gt;
&lt;br /&gt;
在寫程式之前要先製作好資料庫才可以，我建議使用&amp;nbsp;&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;FireFox&lt;/b&gt;&amp;nbsp;的插件 -&amp;nbsp;&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SQLite Manager&lt;/b&gt;。&lt;br /&gt;
下載網址:&amp;nbsp;&lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/5817/&quot; style=&quot;background-color: transparent; border-width: 0px; color: #6666ff; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; text-decoration: underline; vertical-align: baseline;&quot;&gt;https://addons.mozilla.org/en-US/firefox/addon/5817/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SQLite Manager&lt;/b&gt;&amp;nbsp;在 Mac OSX， Linux 或 Windows 環境也一樣可以用到，只要裝到&amp;nbsp;&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;FireFox&lt;/b&gt;&amp;nbsp;就可以用到。&lt;br /&gt;
&lt;br /&gt;
怎麼使用&amp;nbsp;&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SQLite Manager&lt;/b&gt;&amp;nbsp;就不多講了，以下是我的資訊庫的&amp;nbsp;&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;DDL&lt;/b&gt;&amp;nbsp;加上&amp;nbsp;&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;DML&lt;/b&gt;:&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;brush: sql&quot; style=&quot;background-color: transparent; background-image: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg77ogRUqTDi5J9keY1u0JaJz238xumBQisM6C4aXlbFQZ_LolY0IFIrGRACb9Ub0z0IApAbXsMsMfpIlJMOz_Sf_JCcoH82P_w8K5DjKlaUQFrOsJi7rC9LlZK7yC-uHoDWDIJXdRqrCP6/s1600/code.png); background-position: 0px; border-width: 0px; font-size: 13px; margin: 0px 0px 0px 20px; outline-width: 0px; padding: 0px 0px 0px 50px; vertical-align: baseline; width: 480px;&quot;&gt;DROP TABLE IF EXISTS &quot;customer&quot;;
CREATE TABLE &quot;customer&quot; (&quot;pid&quot; INTEGER PRIMARY KEY  AUTOINCREMENT  NOT NULL , &quot;first_name&quot; VARCHAR, &quot;last_name&quot; VARCHAR);
INSERT INTO &quot;customer&quot; VALUES(1,&#39;Lawrence&#39;,&#39;Cheung&#39;);
INSERT INTO &quot;customer&quot; VALUES(2,&#39;Tom&#39;,&#39;Chan&#39;);
INSERT INTO &quot;customer&quot; VALUES(3,&#39;Ken&#39;,&#39;Choi&#39;);
DROP TABLE IF EXISTS &quot;sqlite_sequence&quot;;
CREATE TABLE sqlite_sequence(name,seq);
INSERT INTO &quot;sqlite_sequence&quot; VALUES(&#39;customer&#39;,3);&lt;/pre&gt;&lt;br /&gt;
你要先在&amp;nbsp;&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Project&lt;/b&gt;&amp;nbsp;內增加&amp;nbsp;&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SQLIte&lt;/b&gt;&amp;nbsp;的&amp;nbsp;&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Library&lt;/b&gt;&amp;nbsp;才使用到&amp;nbsp;&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SQLIte&lt;/b&gt;&amp;nbsp;資料庫，將&amp;nbsp;&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;libsqlite3.0.dylib&lt;/b&gt;&amp;nbsp;加入到&amp;nbsp;&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Framework&lt;/b&gt;&amp;nbsp;內。&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: transparent; border-width: 0px; clear: both; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; text-align: left; vertical-align: baseline;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFCy8zvA52G9_ifmvFJKoR9P9k3BPWL7s9tY9mMpKxE2HynR7u6JcqYmOoKL3u9CCl1DkWL8xXGsfRwAgesPL_MOV32Ib68w9vX65F1VVkIBErUdT9MmLQciGGIvgGK4oX0jzthyUWnU_r/s1600/Screen+shot+2010-07-20+at+10.47.10+AM.png&quot; imageanchor=&quot;1&quot; style=&quot;background-color: transparent; border-width: 0px; color: #6666ff; font-size: 13px; margin: 0px 1em; outline-width: 0px; padding: 0px; text-decoration: underline; vertical-align: baseline;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFCy8zvA52G9_ifmvFJKoR9P9k3BPWL7s9tY9mMpKxE2HynR7u6JcqYmOoKL3u9CCl1DkWL8xXGsfRwAgesPL_MOV32Ib68w9vX65F1VVkIBErUdT9MmLQciGGIvgGK4oX0jzthyUWnU_r/s320/Screen+shot+2010-07-20+at+10.47.10+AM.png&quot; style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; max-width: 560px; outline-width: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;&quot; width=&quot;205&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
為了不經常打開資料庫的連接，我使用一個&amp;nbsp;&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Singleton&lt;/b&gt;&amp;nbsp;類別去保持資料庫的連接。這個類別的程式碼:&lt;br /&gt;
DBHelper.h:&lt;br /&gt;
&lt;pre class=&quot;brush: obj-c&quot; style=&quot;background-color: transparent; background-image: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg77ogRUqTDi5J9keY1u0JaJz238xumBQisM6C4aXlbFQZ_LolY0IFIrGRACb9Ub0z0IApAbXsMsMfpIlJMOz_Sf_JCcoH82P_w8K5DjKlaUQFrOsJi7rC9LlZK7yC-uHoDWDIJXdRqrCP6/s1600/code.png); background-position: 0px; border-width: 0px; font-size: 13px; margin: 0px 0px 0px 20px; outline-width: 0px; padding: 0px 0px 0px 50px; vertical-align: baseline; width: 480px;&quot;&gt;#import &amp;lt;sqlite3.h&amp;gt;

@interface DBHelper : NSObject {
 sqlite3 *database;
}

@property(readonly, nonatomic) sqlite3 *database;

+ (DBHelper *) newInstance;
- (void) openDatabase;
- (void) closeDatabase;
- (NSString *) getDatabaseFullPath;
- (void) copyDatabaseIfNeeded;
- (sqlite3_stmt *) executeQuery:(NSString *) query;

@end&lt;/pre&gt;&lt;br /&gt;
DBHelper.m:&lt;br /&gt;
&lt;pre class=&quot;brush: obj-c&quot; style=&quot;background-color: transparent; background-image: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg77ogRUqTDi5J9keY1u0JaJz238xumBQisM6C4aXlbFQZ_LolY0IFIrGRACb9Ub0z0IApAbXsMsMfpIlJMOz_Sf_JCcoH82P_w8K5DjKlaUQFrOsJi7rC9LlZK7yC-uHoDWDIJXdRqrCP6/s1600/code.png); background-position: 0px; border-width: 0px; font-size: 13px; margin: 0px 0px 0px 20px; outline-width: 0px; padding: 0px 0px 0px 50px; vertical-align: baseline; width: 480px;&quot;&gt;#import &quot;DBHelper.h&quot;

@implementation DBHelper

static DBHelper *instance = nil;

NSString *DB_NAME = @&quot;sample&quot;;
NSString *DB_EXT = @&quot;.sqlite&quot;;

@synthesize database;

+ (DBHelper *) newInstance{
   @synchronized(self) {
      if (instance == nil){
         instance = [[DBHelper alloc]init];
         [instance openDatabase];
      }
   }
   return instance;
}

+ (id)allocWithZone:(NSZone *)zone {
   @synchronized(self) {
      if (instance == nil) {
         instance = [super allocWithZone:zone];
         return instance;        
      }
   }
   return nil;
}

- (id)copyWithZone:(NSZone *)zone
{
    return self;
}

- (id)retain {
    return self;
}

- (unsigned)retainCount {
    return UINT_MAX;
}

- (void)release {
    //do nothing
}

- (id)autorelease {
    return self;
}

- (void) openDatabase{
    if (!database){
      [self copyDatabaseIfNeeded];
      int result = sqlite3_open([[self getDatabaseFullPath] UTF8String], &amp;amp;database);
      if (result != SQLITE_OK){
         NSAssert(0, @&quot;Failed to open database&quot;);
      }
   }
}

- (void) closeDatabase{
    if (database){
        sqlite3_close(database);
    }
}

- (void) copyDatabaseIfNeeded{
    NSFileManager *fileManager = [NSFileManager defaultManager];
    NSError *error;
    NSString *dbPath = [self getDatabaseFullPath];
    BOOL success = [fileManager fileExistsAtPath:dbPath]; 
 
    if(!success) {
  
        NSString *defaultDBPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:[NSString stringWithFormat:@&quot;%@%@&quot;, DB_NAME, DB_EXT]];
        success = [fileManager copyItemAtPath:defaultDBPath toPath:dbPath error:&amp;amp;error];
        NSLog(@&quot;Database file copied from bundle to %@&quot;, dbPath);
  
        if (!success){ 
            NSAssert1(0, @&quot;Failed to create writable database file with message &#39;%@&#39;.&quot;, [error localizedDescription]);
        }
        
    } else {
        
        NSLog(@&quot;Database file found at path %@&quot;, dbPath);
  
    }
}

- (NSString *) getDatabaseFullPath{
   NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
   NSString *documentsDirectory = [paths objectAtIndex:0];
   NSString *path = [documentsDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@&quot;%@%@&quot;, DB_NAME, DB_EXT]];
   return path;
}

- (sqlite3_stmt *) executeQuery:(NSString *) query{
   sqlite3_stmt *statement;
   sqlite3_prepare_v2(database, [query UTF8String], -1, &amp;amp;statement, nil);
   return statement;
}

@end&lt;/pre&gt;&lt;br /&gt;
我在這個類別初始化同時會打開資料庫的連接，要在&amp;nbsp;&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;iPhone&lt;/b&gt;&amp;nbsp;開啟&amp;nbsp;&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SQLite&lt;/b&gt;&amp;nbsp;資料庫前，必須要將資料庫複製到&amp;nbsp;&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Documents&lt;/b&gt;&amp;nbsp;目錄內，而其他類別要用 SQL 向資料庫查詢資料只要執行&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;executeQuery&lt;/b&gt;&amp;nbsp;就可以了。&lt;br /&gt;
&lt;br /&gt;
向資料庫查詢資料:&lt;br /&gt;
&lt;pre class=&quot;brush: obj-c&quot; style=&quot;background-color: transparent; background-image: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg77ogRUqTDi5J9keY1u0JaJz238xumBQisM6C4aXlbFQZ_LolY0IFIrGRACb9Ub0z0IApAbXsMsMfpIlJMOz_Sf_JCcoH82P_w8K5DjKlaUQFrOsJi7rC9LlZK7yC-uHoDWDIJXdRqrCP6/s1600/code.png); background-position: 0px; border-width: 0px; font-size: 13px; margin: 0px 0px 0px 20px; outline-width: 0px; padding: 0px 0px 0px 50px; vertical-align: baseline; width: 480px;&quot;&gt;DBHelper *dbHelper = [DBHelper newInstance];
    
NSString *sql = @&quot;SELECT customer.pid, customer.first_name, customer.last_name FROM customer&quot;;
sqlite3_stmt *statement = [dbHelper executeQuery:sql];
    
while(sqlite3_step(statement) == SQLITE_ROW){
    int pid = sqlite3_column_int(statement, 0);
    NSString *firstName = [NSString stringWithUTF8String:(char *)sqlite3_column_text(statement, 1)];
    NSString *lastName = [NSString stringWithUTF8String:(char *)sqlite3_column_text(statement, 2)];
    NSLog(@&quot;pid: %i, first name: %@, last name: %@&quot;, pid, firstName, lastName);
}&lt;/pre&gt;&lt;br /&gt;
執行時在&amp;nbsp;&lt;b style=&quot;background-color: transparent; border-width: 0px; font-size: 13px; margin: 0px; outline-width: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Console&lt;/b&gt;&amp;nbsp;內會打印出以下文字:&lt;br /&gt;
&lt;pre class=&quot;brush: text&quot; style=&quot;background-color: transparent; background-image: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg77ogRUqTDi5J9keY1u0JaJz238xumBQisM6C4aXlbFQZ_LolY0IFIrGRACb9Ub0z0IApAbXsMsMfpIlJMOz_Sf_JCcoH82P_w8K5DjKlaUQFrOsJi7rC9LlZK7yC-uHoDWDIJXdRqrCP6/s1600/code.png); background-position: 0px; border-width: 0px; font-size: 13px; margin: 0px 0px 0px 20px; outline-width: 0px; padding: 0px 0px 0px 50px; vertical-align: baseline; width: 480px;&quot;&gt;[Session started at 2010-07-20 11:31:39 +0800.]
2010-07-20 11:31:41.545 sqlite[39544:207] Database file found at path /Users/Lawrence/Library/Application Support/iPhone Simulator/4.0/Applications/999BFA7F-6D9B-490A-B542-CDCA79B1590E/Documents/sample.sqlite
2010-07-20 11:31:41.547 sqlite[39544:207] pid: 1, first name: Lawrence, last name: Cheung
2010-07-20 11:31:41.548 sqlite[39544:207] pid: 2, first name: Tom, last name: Chan
2010-07-20 11:31:41.549 sqlite[39544:207] pid: 3, first name: Ken, last name: Choi&lt;/pre&gt;&lt;br /&gt;
應用程式完結時記得要將資料庫連接關閉:&lt;br /&gt;
&lt;pre class=&quot;brush: obj-c&quot; id=&quot;&quot; style=&quot;background-color: transparent; background-image: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg77ogRUqTDi5J9keY1u0JaJz238xumBQisM6C4aXlbFQZ_LolY0IFIrGRACb9Ub0z0IApAbXsMsMfpIlJMOz_Sf_JCcoH82P_w8K5DjKlaUQFrOsJi7rC9LlZK7yC-uHoDWDIJXdRqrCP6/s1600/code.png); background-position: 0px; border-width: 0px; font-size: 13px; margin: 0px 0px 0px 20px; outline-width: 0px; padding: 0px 0px 0px 50px; vertical-align: baseline; width: 480px;&quot;&gt;[[DBHelper newInstance] closeDatabase];&lt;/pre&gt;&lt;br /&gt;
文章來源 ：&lt;br /&gt;
http://pro.ctlok.com/p/about.html</content><link rel='replies' type='application/atom+xml' href='http://iphoneipad-develop.blogspot.com/feeds/2046866532215970042/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/02/using-sqlite.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/2046866532215970042'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3644496878787142706/posts/default/2046866532215970042'/><link rel='alternate' type='text/html' href='http://iphoneipad-develop.blogspot.com/2011/02/using-sqlite.html' title='Using SQLite'/><author><name>Hsin</name><uri>http://www.blogger.com/profile/11673965008839019372</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHCbYEown8QoYxImaBJ7gkp4LWmPJHgIS-DE4CfqN0brLrtJHnlue_XikYX52aobHVY_wr8QGlMgbG2myV_0DtZeHMbpJr7GpclQIeYYkdEi_xRmK001m5kf3gG57zxw/s220/1.sLByIvXvAHN'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFCy8zvA52G9_ifmvFJKoR9P9k3BPWL7s9tY9mMpKxE2HynR7u6JcqYmOoKL3u9CCl1DkWL8xXGsfRwAgesPL_MOV32Ib68w9vX65F1VVkIBErUdT9MmLQciGGIvgGK4oX0jzthyUWnU_r/s72-c/Screen+shot+2010-07-20+at+10.47.10+AM.png" height="72" width="72"/><thr:total>0</thr:total></entry></feed>