<?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-379527003650342663</id><updated>2026-08-30T15:40:45.031+08:00</updated><category term="Android"/><category term="iOS"/><category term="Mapguide"/><category term="Flex"/><category term="喜歡的事"/><category term="說教與被說教"/><category term="作品"/><category term="asp.net"/><category term="ArcGIS Server"/><category term="JQuery"/><category term="WOW"/><category term="軟體安裝"/><category term="SQL Spatial"/><category term="吃與樂"/><category term="網頁美編"/><category term="討厭的事"/><category term="DataBase"/><category term="OLAccount"/><category term="日常生活"/><category term="Oracel Spatial"/><category term="SQL"/><category term="Service"/><category term="Oracel"/><category term="GIS"/><category term="WCF"/><category term="JAVA"/><category term="Photoshop"/><category term="3DGIS"/><category term="C#"/><category term="ArcMap"/><category term="JavaScript"/><category term="PV3D"/><category term="WinServer2008"/><category term="Windows 8"/><title type='text'>ola的家</title><subtitle type='html'>關於ola所學的地理資訊系統、程式開發及心情.....</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://wangshifuola.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://wangshifuola.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>ola的家</name><uri>http://www.blogger.com/profile/17489699564369049796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUnrwMn6IvUcuEcU6tWY-mlfvU1rZ3NW6EHCAesBaOiHpoDNeJhCgJty3EnJXTHPsjYR53NutZLnli4xiUs1S9da7RXeblHyEORnvbxTUKIYg_x5uU146P69PXmq_fLw/s220/IMG_0442.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>382</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-379527003650342663.post-6999856145686920926</id><published>2014-05-29T10:52:00.002+08:00</published><updated>2014-05-29T11:03:22.600+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="喜歡的事"/><title type='text'></title><content type='html'></content><link rel='replies' type='application/atom+xml' href='http://wangshifuola.blogspot.com/feeds/6999856145686920926/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://wangshifuola.blogspot.com/2014/05/blog-post_29.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/6999856145686920926'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/6999856145686920926'/><link rel='alternate' type='text/html' href='http://wangshifuola.blogspot.com/2014/05/blog-post_29.html' title=''/><author><name>ola的家</name><uri>http://www.blogger.com/profile/17489699564369049796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUnrwMn6IvUcuEcU6tWY-mlfvU1rZ3NW6EHCAesBaOiHpoDNeJhCgJty3EnJXTHPsjYR53NutZLnli4xiUs1S9da7RXeblHyEORnvbxTUKIYg_x5uU146P69PXmq_fLw/s220/IMG_0442.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-379527003650342663.post-3764918657750385649</id><published>2014-03-31T21:56:00.001+08:00</published><updated>2014-03-31T21:56:04.123+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="3DGIS"/><category scheme="http://www.blogger.com/atom/ns#" term="GIS"/><category scheme="http://www.blogger.com/atom/ns#" term="喜歡的事"/><title type='text'>DEM Put Z Value紀念</title><content type='html'>延續假日的氣勢，阿斯~~~~~~~~~！  齁齁齁！
&lt;br/&gt;
&lt;br/&gt;
&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/AVvXsEjQqGsQ3-pN4HKKgaUbUyENrdXJTdAY5PLAFhEJV2n9dDW60OQp1z1HH06ujvJvpy9ojV12JjRu6KgNzexwGNBQrfKD3ybk5bgGzzXa-OZg4l3F8gOGCW2G5f67pE3nfIUffxRnnM8zj2c/s1600/DTMPut.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQqGsQ3-pN4HKKgaUbUyENrdXJTdAY5PLAFhEJV2n9dDW60OQp1z1HH06ujvJvpy9ojV12JjRu6KgNzexwGNBQrfKD3ybk5bgGzzXa-OZg4l3F8gOGCW2G5f67pE3nfIUffxRnnM8zj2c/s640/DTMPut.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wangshifuola.blogspot.com/feeds/3764918657750385649/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://wangshifuola.blogspot.com/2014/03/dem-put-z-value.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/3764918657750385649'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/3764918657750385649'/><link rel='alternate' type='text/html' href='http://wangshifuola.blogspot.com/2014/03/dem-put-z-value.html' title='DEM Put Z Value紀念'/><author><name>ola的家</name><uri>http://www.blogger.com/profile/17489699564369049796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUnrwMn6IvUcuEcU6tWY-mlfvU1rZ3NW6EHCAesBaOiHpoDNeJhCgJty3EnJXTHPsjYR53NutZLnli4xiUs1S9da7RXeblHyEORnvbxTUKIYg_x5uU146P69PXmq_fLw/s220/IMG_0442.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQqGsQ3-pN4HKKgaUbUyENrdXJTdAY5PLAFhEJV2n9dDW60OQp1z1HH06ujvJvpy9ojV12JjRu6KgNzexwGNBQrfKD3ybk5bgGzzXa-OZg4l3F8gOGCW2G5f67pE3nfIUffxRnnM8zj2c/s72-c/DTMPut.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-379527003650342663.post-6536545247559355843</id><published>2014-03-29T22:15:00.001+08:00</published><updated>2014-03-29T22:15:35.734+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="GIS"/><category scheme="http://www.blogger.com/atom/ns#" term="喜歡的事"/><title type='text'>DEM Get Z Value紀念</title><content type='html'>很久沒有在家裡寫程式了，今天放著PS3、暗黑3不玩，只因為這個題目太有趣，僅以本篇文章感謝今日成果的大功成：瑋哥，你實在是我見過最無私、有實力、夠龜毛的硬底子工程師！！
&lt;br/&gt;
&lt;br/&gt;
&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/AVvXsEh-9hHQelFzSekWzv_0Z7wrw7kO_r7g6z5xcHnSfqqd93MrrMNPiDii6mqJ1gCqECasT0vWupAnXMQ47stHD5DFQOe3E4n6_qzJCDmf1F6QkoEXphdbLoqzVcamaSYEcOjuc_-c73ixXRQ/s1600/DTM_%E3%84%8E%E3%84%8E.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-9hHQelFzSekWzv_0Z7wrw7kO_r7g6z5xcHnSfqqd93MrrMNPiDii6mqJ1gCqECasT0vWupAnXMQ47stHD5DFQOe3E4n6_qzJCDmf1F6QkoEXphdbLoqzVcamaSYEcOjuc_-c73ixXRQ/s400/DTM_%E3%84%8E%E3%84%8E.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://wangshifuola.blogspot.com/feeds/6536545247559355843/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://wangshifuola.blogspot.com/2014/03/dem-get-z-value.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/6536545247559355843'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/6536545247559355843'/><link rel='alternate' type='text/html' href='http://wangshifuola.blogspot.com/2014/03/dem-get-z-value.html' title='DEM Get Z Value紀念'/><author><name>ola的家</name><uri>http://www.blogger.com/profile/17489699564369049796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUnrwMn6IvUcuEcU6tWY-mlfvU1rZ3NW6EHCAesBaOiHpoDNeJhCgJty3EnJXTHPsjYR53NutZLnli4xiUs1S9da7RXeblHyEORnvbxTUKIYg_x5uU146P69PXmq_fLw/s220/IMG_0442.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-9hHQelFzSekWzv_0Z7wrw7kO_r7g6z5xcHnSfqqd93MrrMNPiDii6mqJ1gCqECasT0vWupAnXMQ47stHD5DFQOe3E4n6_qzJCDmf1F6QkoEXphdbLoqzVcamaSYEcOjuc_-c73ixXRQ/s72-c/DTM_%E3%84%8E%E3%84%8E.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-379527003650342663.post-7683765149606483872</id><published>2014-02-19T18:09:00.000+08:00</published><updated>2014-02-19T18:10:20.132+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript"/><title type='text'>js小抄_動態的變數名稱[使用eval()方法]</title><content type='html'>有時候會有一個需求，想在某種情況代入變數Value_A，某些時候代入變數Value_B，那可能會寫：&lt;br /&gt;
&lt;code&gt;
var output = &#39;&#39;; 
if (status==&#39;A&#39;){
    output = Value_A
}
if else(status==&#39;B&#39;){
    output = Value_B
}
alert(output);
&lt;/code&gt;
&lt;br /&gt;
但若是情況有100種，豈不是要寫100個判斷式處理；這時，可以使用eval()方法來處理：&lt;br /&gt;
&lt;code&gt;
var output = eval(&#39;Value_&#39; + status); 
alert(output);
&lt;/code&gt;
&lt;br /&gt;
上述方式，將可在status為A時，取到Value_A的值，status為GG時，取到Value_GG的值，大大使程式碼更加靈活。
&lt;br /&gt;
&lt;br /&gt;
eval()也就是將函式內的內容組合完成後，以JavaScript執行，所以能夠產生許多巧妙的變化，常被舉的例子是：
&lt;br /&gt;
&lt;code&gt;
var n=2;
var b=3,c=4; 
eval(&#39;a&#39;+n+&#39;=b*c&#39;);
&lt;/code&gt;
&lt;br /&gt;
上式會得出a2變數為12。
</content><link rel='replies' type='application/atom+xml' href='http://wangshifuola.blogspot.com/feeds/7683765149606483872/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://wangshifuola.blogspot.com/2014/02/jseval.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/7683765149606483872'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/7683765149606483872'/><link rel='alternate' type='text/html' href='http://wangshifuola.blogspot.com/2014/02/jseval.html' title='js小抄_動態的變數名稱[使用eval()方法]'/><author><name>ola的家</name><uri>http://www.blogger.com/profile/17489699564369049796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUnrwMn6IvUcuEcU6tWY-mlfvU1rZ3NW6EHCAesBaOiHpoDNeJhCgJty3EnJXTHPsjYR53NutZLnli4xiUs1S9da7RXeblHyEORnvbxTUKIYg_x5uU146P69PXmq_fLw/s220/IMG_0442.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-379527003650342663.post-7269397884195988621</id><published>2014-02-14T19:45:00.002+08:00</published><updated>2014-02-14T19:46:36.028+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ArcGIS Server"/><category scheme="http://www.blogger.com/atom/ns#" term="JQuery"/><title type='text'>jQuery_動態載入js與html</title><content type='html'>最近為了重拾JavaScript，灌了VS2013，被強制升級為IE11，才知道原來IE11執行js的效能不錯，錯誤&quot;似乎&quot;也變少許多，但我想絕大部分的使用者短期內都不可能升級吧！ &amp;nbsp;:D&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
JavaScript實在是太不熟悉，也不知道用什麼架構可以建置一個稍具規模的專案，在看不太懂網路上各大大的模組化後，決定亂建一個方式，總是有一個起頭，先記錄一下關鍵。&lt;br /&gt;
&lt;br /&gt;
1. 使用jQuery動態載入HTML(&lt;a href=&quot;https://api.jquery.com/load/&quot; target=&quot;_blank&quot;&gt;官網&lt;/a&gt;)&lt;br /&gt;
&lt;code&gt;
$(&quot;#div1&quot;).load(&quot;widgets/function/functionPage1.html&quot;, function () {
        console.log(&quot;Load functionPage1.html OK.&quot;);
});
&lt;/code&gt;
使用jQuery可以相當簡便的將functionPage1.html插入名為div1的容器中，達到頁面分離效果。
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. 使用jQuery動態載入js(&lt;a href=&quot;https://api.jquery.com/jQuery.getScript/&quot; target=&quot;_blank&quot;&gt;官網&lt;/a&gt;)&lt;br /&gt;
&lt;code&gt;
$.getScript(&quot;function/jfunction1.js&quot;, function (data, textStatus, jqxhr) {
    console.log(data); // Data returned
    console.log(textStatus); // Success
    console.log(jqxhr.status); // 200
    console.log(&quot;Load jfunction1 was performed.&quot;);
});
&lt;/code&gt;
利用getScript方法，將jfunction1.js動態讀取到頁面中，當完成時會觸發後面的function，可以做為init之用。
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
有了這兩個方法，接著就是試圖把html與js分門別類的抽出，再於適當的時機讀取(要使用前)，看到主頁清爽的感覺就是爽！  :D</content><link rel='replies' type='application/atom+xml' href='http://wangshifuola.blogspot.com/feeds/7269397884195988621/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://wangshifuola.blogspot.com/2014/02/jqueryjshtml.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/7269397884195988621'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/7269397884195988621'/><link rel='alternate' type='text/html' href='http://wangshifuola.blogspot.com/2014/02/jqueryjshtml.html' title='jQuery_動態載入js與html'/><author><name>ola的家</name><uri>http://www.blogger.com/profile/17489699564369049796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUnrwMn6IvUcuEcU6tWY-mlfvU1rZ3NW6EHCAesBaOiHpoDNeJhCgJty3EnJXTHPsjYR53NutZLnli4xiUs1S9da7RXeblHyEORnvbxTUKIYg_x5uU146P69PXmq_fLw/s220/IMG_0442.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-379527003650342663.post-3032639907566141324</id><published>2013-12-22T08:10:00.001+08:00</published><updated>2013-12-22T08:10:45.294+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="OLAccount"/><title type='text'>Olaccount如何進行備份及還原</title><content type='html'>&lt;div style=&quot;font-family: arial; font-size: small;&quot;&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;備份步驟如下：&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;1. 選擇自動備份功能，第一次使用軟體詢問時打勾；或於設定中將自動備份功能開啟。&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;2. 手動備份：利用匯出/匯入功能，選擇&#39;匯出CSV檔案&#39;功能。&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;*. 以上功能皆會將備份檔案儲存於SDCard的OLAccount資料夾(於根目錄內)。&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;--------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;還原步驟如下：&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;1. 將備份資料存出，位置在SDCard的OLAccount資料夾(於根目錄內)。&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;2. 若存出後有用EXCEL進行編修過，請先以附屬應用程式的記事本另存新檔為UTF-8格式(於存檔鈕的左方編碼下拉式選單選擇)。&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;3. 將該檔案儲存到新手機SDCard的OLAccount資料夾(於根目錄內)。(若沒有資料夾，可以自己建一個，或是先使用帳本的自動備份或手動備份，帳本會自動建立)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;4. 進入OLAccount程式，選擇匯出/匯入功能，點選&quot;選擇檔案&quot;，選擇剛剛放進資料夾的檔案。&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;5. 點擊&quot;匯入CSV檔&quot;功能。&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;---------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: white;&quot;&gt;**. 備分功能儲存在SDCard中，若是SDCard損壞則無法還原，可自行將備份檔案寄送至Mail。&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: arial; font-size: small;&quot;&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: arial; font-size: small;&quot;&gt;
&lt;span style=&quot;color: white;&quot;&gt;功能位置：&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: arial; font-size: small;&quot;&gt;
&lt;span style=&quot;color: white;&quot;&gt;選擇匯出/匯入功能，先設定常用Mail；再利用寄送e-Mail送至自己的信箱。&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://wangshifuola.blogspot.com/feeds/3032639907566141324/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://wangshifuola.blogspot.com/2013/12/olaccount.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/3032639907566141324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/3032639907566141324'/><link rel='alternate' type='text/html' href='http://wangshifuola.blogspot.com/2013/12/olaccount.html' title='Olaccount如何進行備份及還原'/><author><name>ola的家</name><uri>http://www.blogger.com/profile/17489699564369049796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUnrwMn6IvUcuEcU6tWY-mlfvU1rZ3NW6EHCAesBaOiHpoDNeJhCgJty3EnJXTHPsjYR53NutZLnli4xiUs1S9da7RXeblHyEORnvbxTUKIYg_x5uU146P69PXmq_fLw/s220/IMG_0442.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-379527003650342663.post-3561675794167986873</id><published>2013-10-31T15:05:00.002+08:00</published><updated>2013-10-31T15:05:44.913+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><title type='text'>iOS小抄_讓CLLocationManager持續在背景執行</title><content type='html'>到TARGETS的Info中，於Custom iOS Target Properties加入：&lt;br /&gt;
&lt;br /&gt;
Required background modes，並在子項中加入App registers for location updates。&lt;br /&gt;
&lt;br /&gt;
&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/AVvXsEhlBV41MiQUEvCvkP1Zk2IzmyebEnyYJniJ6cqOEUUxuH3i3PeAOwN_b5H_sroLQ0cz6_d2uCD81DRPjGFslHCLFkr97j2tjxStxNolIjY8HN7rh3I92FD8rad1y2uO0KgLON9I1zmR0Zk/s1600/CLLocationManager%E6%8C%81%E7%BA%8C%E5%9C%A8%E8%83%8C%E6%99%AF%E5%9F%B7%E8%A1%8C.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlBV41MiQUEvCvkP1Zk2IzmyebEnyYJniJ6cqOEUUxuH3i3PeAOwN_b5H_sroLQ0cz6_d2uCD81DRPjGFslHCLFkr97j2tjxStxNolIjY8HN7rh3I92FD8rad1y2uO0KgLON9I1zmR0Zk/s1600/CLLocationManager%E6%8C%81%E7%BA%8C%E5%9C%A8%E8%83%8C%E6%99%AF%E5%9F%B7%E8%A1%8C.png&quot; height=&quot;56&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://wangshifuola.blogspot.com/feeds/3561675794167986873/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://wangshifuola.blogspot.com/2013/10/ioscllocationmanager.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/3561675794167986873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/3561675794167986873'/><link rel='alternate' type='text/html' href='http://wangshifuola.blogspot.com/2013/10/ioscllocationmanager.html' title='iOS小抄_讓CLLocationManager持續在背景執行'/><author><name>ola的家</name><uri>http://www.blogger.com/profile/17489699564369049796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUnrwMn6IvUcuEcU6tWY-mlfvU1rZ3NW6EHCAesBaOiHpoDNeJhCgJty3EnJXTHPsjYR53NutZLnli4xiUs1S9da7RXeblHyEORnvbxTUKIYg_x5uU146P69PXmq_fLw/s220/IMG_0442.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlBV41MiQUEvCvkP1Zk2IzmyebEnyYJniJ6cqOEUUxuH3i3PeAOwN_b5H_sroLQ0cz6_d2uCD81DRPjGFslHCLFkr97j2tjxStxNolIjY8HN7rh3I92FD8rad1y2uO0KgLON9I1zmR0Zk/s72-c/CLLocationManager%E6%8C%81%E7%BA%8C%E5%9C%A8%E8%83%8C%E6%99%AF%E5%9F%B7%E8%A1%8C.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-379527003650342663.post-8416794271859172810</id><published>2013-09-30T17:31:00.000+08:00</published><updated>2013-09-30T17:31:44.213+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="說教與被說教"/><title type='text'>給他魚吃，不如教他釣魚。</title><content type='html'>自己喜歡學釣魚、教釣魚，不代表大家都喜歡，&lt;br/&gt;
&lt;br/&gt;
無謂的堅持放在自己與一起有堅持的人身上，&lt;br/&gt;
&lt;br/&gt;
每件人事物都在不經意的情況下企圖教你些「事情」，&lt;br/&gt;
&lt;br/&gt;
:D

</content><link rel='replies' type='application/atom+xml' href='http://wangshifuola.blogspot.com/feeds/8416794271859172810/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://wangshifuola.blogspot.com/2013/09/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/8416794271859172810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/8416794271859172810'/><link rel='alternate' type='text/html' href='http://wangshifuola.blogspot.com/2013/09/blog-post.html' title='給他魚吃，不如教他釣魚。'/><author><name>ola的家</name><uri>http://www.blogger.com/profile/17489699564369049796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUnrwMn6IvUcuEcU6tWY-mlfvU1rZ3NW6EHCAesBaOiHpoDNeJhCgJty3EnJXTHPsjYR53NutZLnli4xiUs1S9da7RXeblHyEORnvbxTUKIYg_x5uU146P69PXmq_fLw/s220/IMG_0442.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-379527003650342663.post-3240648225654789127</id><published>2013-06-21T14:15:00.001+08:00</published><updated>2013-06-21T14:15:37.456+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL Spatial"/><title type='text'>SQL Spatial小抄_查詢geometry欄位為wkt字串</title><content type='html'>久沒寫一下就忘記了，小抄一下。&lt;br/&gt;
&lt;br/&gt;
&lt;code&gt;
SELECT [OBJECTID],[Name],[Shape].STAsText() as WKT FROM table
&lt;/code&gt;
&lt;br/&gt;
&lt;br/&gt;
Binary格式：&lt;br/&gt;
SELECT SHAPE.STAsBinary() as WKB FROM suburbs WHERE SHAPE IS NOT NULL</content><link rel='replies' type='application/atom+xml' href='http://wangshifuola.blogspot.com/feeds/3240648225654789127/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://wangshifuola.blogspot.com/2013/06/sql-spatialgeometrywkt.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/3240648225654789127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/3240648225654789127'/><link rel='alternate' type='text/html' href='http://wangshifuola.blogspot.com/2013/06/sql-spatialgeometrywkt.html' title='SQL Spatial小抄_查詢geometry欄位為wkt字串'/><author><name>ola的家</name><uri>http://www.blogger.com/profile/17489699564369049796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUnrwMn6IvUcuEcU6tWY-mlfvU1rZ3NW6EHCAesBaOiHpoDNeJhCgJty3EnJXTHPsjYR53NutZLnli4xiUs1S9da7RXeblHyEORnvbxTUKIYg_x5uU146P69PXmq_fLw/s220/IMG_0442.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-379527003650342663.post-5490437484179481583</id><published>2013-05-15T11:52:00.001+08:00</published><updated>2013-05-15T11:52:19.621+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ArcGIS Server"/><category scheme="http://www.blogger.com/atom/ns#" term="Flex"/><title type='text'>ArcGIS Server Flex Viewer的事件傳遞(AppEvent)</title><content type='html'>一般在Flex裡面進行事件傳遞，都是以dispatchEvent來進行傳遞，例如：&lt;br/&gt;
&lt;code&gt;
dispatchEvent(new Event(LOCATE_RESULT_CLICK, true));
&lt;/code&gt;
&lt;br/&gt;
但在ArcGIS Server Flex Viewer內註冊了自己的事件傳遞，也就是利用AppEvent這一個as來進行操作，&lt;br/&gt;
所以當我們看到某個widget內以AppEvent.addListener的方式註冊事件，&lt;br/&gt;
在別的widget想要呼叫時，就必須使用AppEvent來進行呼叫。&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
方式：&lt;br/&gt;
&lt;code&gt;
AppEvent.dispatch(AppEvent.REFRESH_LEGEND);
&lt;/code&gt;</content><link rel='replies' type='application/atom+xml' href='http://wangshifuola.blogspot.com/feeds/5490437484179481583/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://wangshifuola.blogspot.com/2013/05/arcgis-server-flex-viewerappevent.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/5490437484179481583'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/5490437484179481583'/><link rel='alternate' type='text/html' href='http://wangshifuola.blogspot.com/2013/05/arcgis-server-flex-viewerappevent.html' title='ArcGIS Server Flex Viewer的事件傳遞(AppEvent)'/><author><name>ola的家</name><uri>http://www.blogger.com/profile/17489699564369049796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUnrwMn6IvUcuEcU6tWY-mlfvU1rZ3NW6EHCAesBaOiHpoDNeJhCgJty3EnJXTHPsjYR53NutZLnli4xiUs1S9da7RXeblHyEORnvbxTUKIYg_x5uU146P69PXmq_fLw/s220/IMG_0442.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-379527003650342663.post-1774201819097118068</id><published>2013-05-15T11:41:00.003+08:00</published><updated>2013-05-15T11:41:47.525+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><title type='text'>iOS小抄_設定可利用iTunes管理document資料夾</title><content type='html'>沒作筆記，一下子又要忘記了，趕快寫一下。&lt;br/&gt;
&lt;br/&gt;
步驟：&lt;br/&gt;
於plist右鍵，點擊Add Row，增加Application supports iTunes file sharing項目，並將屬性設為YES。&lt;br/&gt;
&lt;br/&gt;
就可以將iPad接上電腦後，以iTunes直接拉檔案到該App的document資料夾。</content><link rel='replies' type='application/atom+xml' href='http://wangshifuola.blogspot.com/feeds/1774201819097118068/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://wangshifuola.blogspot.com/2013/05/iositunesdocument.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/1774201819097118068'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/1774201819097118068'/><link rel='alternate' type='text/html' href='http://wangshifuola.blogspot.com/2013/05/iositunesdocument.html' title='iOS小抄_設定可利用iTunes管理document資料夾'/><author><name>ola的家</name><uri>http://www.blogger.com/profile/17489699564369049796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUnrwMn6IvUcuEcU6tWY-mlfvU1rZ3NW6EHCAesBaOiHpoDNeJhCgJty3EnJXTHPsjYR53NutZLnli4xiUs1S9da7RXeblHyEORnvbxTUKIYg_x5uU146P69PXmq_fLw/s220/IMG_0442.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-379527003650342663.post-4827600204496694337</id><published>2013-04-11T09:38:00.001+08:00</published><updated>2013-04-11T09:41:24.781+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><title type='text'>iOS學習_UILabel配合字數調整高度(使用sizeWithFont)</title><content type='html'>有很多時候我們在呈現簡介，備註或說明等欄位時，會遇到文字過長UILabel無法一次顯示的狀況，最好的辦法莫過於從資料庫撈出的字數與想要顯示的字體大小來計算出UILabel應該有的寬高，而在iOS的字串內有一個很讚的方法：sizeWithFont。
&lt;br/&gt;
&lt;code&gt;
CGSize stringSize = [datastring sizeWithFont:[UIFont systemFontOfSize:17]
                  constrainedToSize:CGSizeMake(canputwidth,CGFLOAT_MAX)
                      lineBreakMode:NSLineBreakByWordWrapping];
&lt;/code&gt;
&lt;br/&gt;
說明：計算datastring在17字體大小下，擺在canputwidth的寬度中，並且以文字換行的方式計算CGSize。
&lt;br/&gt;
&lt;br/&gt;
獲得CGSize後即可由stringSize.width與stringSize.height取得需要的寬高，在利用setFrame來重新給定UILabel的高度。
&lt;br/&gt;
&lt;br/&gt;
程式碼：
&lt;br/&gt;
&lt;code&gt;
-(void)someMethod:(NSString*)name
{
    int fontsize = 17;
    CGSize labSize = [self calwordH:name canputwidth:self.view.bounds.size.width];
    UILabel *fieldlb = [[UILabel alloc] init];    
    fieldlb.font = [UIFont systemFontOfSize:fontsize];
    fieldlb.backgroundColor = color;
    fieldlb.text = name;
    [fieldlb setNumberOfLines:0];
    fieldlb.lineBreakMode = NSLineBreakByWordWrapping;
    [fieldlb setFrame:CGRectMake(0.0f,0.0f,labSize.width,labSize.height)];

    [self.view addSubview:fieldlb];
}

-(CGSize) calwordH:(NSString *)string canputwidth:(int)canputwidth
{
    CGSize s = [string sizeWithFont:[UIFont systemFontOfSize:17]
                  constrainedToSize:CGSizeMake(canputwidth,CGFLOAT_MAX)
                      lineBreakMode:NSLineBreakByWordWrapping];

    return s;
}
&lt;/code&gt;
&lt;br/&gt;
&lt;br/&gt;
iOS6以後NSLineBreakByWordWrapping改為NSLineBreakByWordWrapping。


</content><link rel='replies' type='application/atom+xml' href='http://wangshifuola.blogspot.com/feeds/4827600204496694337/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://wangshifuola.blogspot.com/2013/04/iosuilabelsizewithfont.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/4827600204496694337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/4827600204496694337'/><link rel='alternate' type='text/html' href='http://wangshifuola.blogspot.com/2013/04/iosuilabelsizewithfont.html' title='iOS學習_UILabel配合字數調整高度(使用sizeWithFont)'/><author><name>ola的家</name><uri>http://www.blogger.com/profile/17489699564369049796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUnrwMn6IvUcuEcU6tWY-mlfvU1rZ3NW6EHCAesBaOiHpoDNeJhCgJty3EnJXTHPsjYR53NutZLnli4xiUs1S9da7RXeblHyEORnvbxTUKIYg_x5uU146P69PXmq_fLw/s220/IMG_0442.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-379527003650342663.post-1501902024361920787</id><published>2013-03-21T14:15:00.001+08:00</published><updated>2013-03-21T14:17:12.962+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><title type='text'>iOS學習_使用企業帳號發布</title><content type='html'>&lt;br /&gt;
很謎的企業用帳號，很有趣的帳號管理，:D&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
開發使用：&lt;br /&gt;
&lt;br /&gt;
1. 在Mac，開啓鑰匙圈，確認偏好設定內的，憑證，線上憑證狀態協定(OCSP與CRL為停用)&lt;br /&gt;
&lt;br /&gt;
2. 選擇選單鑰匙圈存取&amp;gt;憑證輔助程式&amp;gt;由憑證授權要求憑證，匯出憑證授權。(EX:CertificateSigningRequest_enterprise_ola.certSigningRequest)&lt;br /&gt;
&lt;br /&gt;
3. 電子郵件填寫已經加入企用帳號的Apple ID，取名稱(enterprise_ola)，並選擇儲存到磁碟，勾選指定密鑰配對資訊。&lt;br /&gt;
&lt;br /&gt;
4. 選擇密鑰大小2048與RSA演算法。&lt;br /&gt;
&lt;br /&gt;
5. 進到 https://developer.apple.com&lt;br /&gt;
&lt;br /&gt;
6. 點擊iOS Dev Center&lt;br /&gt;
&lt;br /&gt;
7. login步驟三的Apple ID&lt;br /&gt;
&lt;br /&gt;
8. 登入後，點擊右側iOS Provisioning&lt;br /&gt;
&lt;br /&gt;
9. 選擇左側選單Certificates，於Development上傳剛剛建立的檔案(CertificateSigningRequest_enterprise_ola.certSigningRequest)&lt;br /&gt;
&lt;br /&gt;
10. 重新整理網頁以後，可以下載XXX.cer檔案，雙擊兩下存入鑰匙圈。&lt;br /&gt;
&lt;br /&gt;
11. 回到網站，選擇左側選單的Provisioning。&lt;br /&gt;
&lt;br /&gt;
12. 點擊New Profile，建立一個新的Provision，AppID在開發階段可以先用：Xcode iOS Wildcard App ID&lt;br /&gt;
&lt;br /&gt;
13. 下載後雙擊兩下進到Xcode Organizer的Provisioning Profiles。&lt;br /&gt;
&lt;br /&gt;
14. 至project/Build Settings/Code Signing Identity，更改Debug使用的憑證，測試是否可以正常由Xcode灌到測試機當中。&lt;br /&gt;
&lt;br /&gt;
------------------------------------------&lt;br /&gt;
發佈使用：&lt;br /&gt;
&lt;br /&gt;
1. 至網頁的Certificates Distribution下載發佈用的Certificate(EX:Ola Engineering Consultants, inc.,Taiwan)&lt;br /&gt;
&lt;br /&gt;
2. 雙擊兩下進到鑰匙圈的憑證內。&lt;br /&gt;
*.若是Provisioning Profiles出現valid signing identity not found，則去檢查鑰匙圈內的憑證是否有跟著對應的鑰匙，若無則必須去取得第一個建立Certificate的人，&lt;br /&gt;
利用其電腦匯出p12檔案，再雙擊加入要持圈即可。(或是Revoke企業帳號內的Distribution Certificate並重新建立，但往後有人需使用則必須你電腦匯出的p12檔案)&lt;br /&gt;
&lt;br /&gt;
3. 建立AppID，該名稱似乎無法刪除與更改，請謹慎命名。(Bundle Identifier可至XCode的targets內summary查。&lt;br /&gt;
&lt;br /&gt;
5. 至Provisioning的Distribution建立Provision&lt;br /&gt;
&lt;br /&gt;
6. 選擇In House，輸入Profile name。&lt;br /&gt;
&lt;br /&gt;
7. 下載後雙擊兩下，進到Xcode Organizer的Provisioning Profiles&lt;br /&gt;
&lt;br /&gt;
8. 至專案info的Configurations增加Inhouse項目。&lt;br /&gt;
&lt;br /&gt;
9. 至project/Build Settings/Code Signing Identity，更改Inhouse使用剛剛下載的憑證。&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
開始匯出，發佈：&lt;br /&gt;
&lt;br /&gt;
1. 先準備一個要放置下載位置的網站，於該網站的MIME類型加入ipa與plist&lt;br /&gt;
&lt;br /&gt;
.ipa | application/octet-stream&lt;br /&gt;
.plist | text/xml&lt;br /&gt;
&lt;br /&gt;
2. 開好要放入下載app資料夾，並記錄該位置(EX:http://ola.com.tw/appdownload/)&lt;br /&gt;
&lt;br /&gt;
3. 於Xcode選擇Product &amp;gt; Archive &amp;gt; Distribute&lt;br /&gt;
&lt;br /&gt;
4. 選第二個Save for Enterprise or Ad-Hoc Deployment&lt;br /&gt;
&lt;br /&gt;
5. 於儲存時，勾選下方的&quot;Save for Enterprise Distribution&quot;，並輸入Application URL與Title&lt;br /&gt;
Application URL：http://ola.com.tw/appdownload/ola.ipa&lt;br /&gt;
Title:ola app&lt;br /&gt;
&lt;br /&gt;
6. 將匯出後的檔案(ipa與plist)放置到步驟2的位置(EX:ola.com.tw/appdownload/內)&lt;br /&gt;
&lt;br /&gt;
7. 於上述位置準備下載頁面，下載按鈕撰寫方式如下：&lt;br /&gt;
&lt;br /&gt;
8. 使用ios產品下載看看。&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://wangshifuola.blogspot.com/feeds/1501902024361920787/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://wangshifuola.blogspot.com/2013/03/ios.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/1501902024361920787'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/1501902024361920787'/><link rel='alternate' type='text/html' href='http://wangshifuola.blogspot.com/2013/03/ios.html' title='iOS學習_使用企業帳號發布'/><author><name>ola的家</name><uri>http://www.blogger.com/profile/17489699564369049796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUnrwMn6IvUcuEcU6tWY-mlfvU1rZ3NW6EHCAesBaOiHpoDNeJhCgJty3EnJXTHPsjYR53NutZLnli4xiUs1S9da7RXeblHyEORnvbxTUKIYg_x5uU146P69PXmq_fLw/s220/IMG_0442.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-379527003650342663.post-2891131766654562806</id><published>2013-03-04T01:12:00.001+08:00</published><updated>2013-03-04T01:12:32.972+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="WOW"/><title type='text'>豐泉台_煞終於倒囉！</title><content type='html'>就在5.2的前夕，豐泉台四王終於倒了！&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnzL99WJpfwSLaTpXeZDnZ8R8nXdLMn24q5c8CL9OZQg63al0Cpiaw6gTjheHy6tfLhJ5h4KRfvhKbu0pukAfs2kDNjp5uqF2WKYrKG37-AhSU6ejXTZ5FgvJ3BuY2MJNoM6UQRRn1bxc/s1600/%E7%85%9E.jpg&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;512&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnzL99WJpfwSLaTpXeZDnZ8R8nXdLMn24q5c8CL9OZQg63al0Cpiaw6gTjheHy6tfLhJ5h4KRfvhKbu0pukAfs2kDNjp5uqF2WKYrKG37-AhSU6ejXTZ5FgvJ3BuY2MJNoM6UQRRn1bxc/s640/%E7%85%9E.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
感謝：阿龍、辰藍、飛魚、若琪、kaka、飆魔、拉拉、真影、努力實習的cc、++與超人氣ola。 
&lt;br /&gt;
&lt;br /&gt;
可以快樂迎接5.2魔獸與蟲族之心了！！
</content><link rel='replies' type='application/atom+xml' href='http://wangshifuola.blogspot.com/feeds/2891131766654562806/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://wangshifuola.blogspot.com/2013/03/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/2891131766654562806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/2891131766654562806'/><link rel='alternate' type='text/html' href='http://wangshifuola.blogspot.com/2013/03/blog-post.html' title='豐泉台_煞終於倒囉！'/><author><name>ola的家</name><uri>http://www.blogger.com/profile/17489699564369049796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUnrwMn6IvUcuEcU6tWY-mlfvU1rZ3NW6EHCAesBaOiHpoDNeJhCgJty3EnJXTHPsjYR53NutZLnli4xiUs1S9da7RXeblHyEORnvbxTUKIYg_x5uU146P69PXmq_fLw/s220/IMG_0442.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnzL99WJpfwSLaTpXeZDnZ8R8nXdLMn24q5c8CL9OZQg63al0Cpiaw6gTjheHy6tfLhJ5h4KRfvhKbu0pukAfs2kDNjp5uqF2WKYrKG37-AhSU6ejXTZ5FgvJ3BuY2MJNoM6UQRRn1bxc/s72-c/%E7%85%9E.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-379527003650342663.post-8154295329440383369</id><published>2013-02-16T13:25:00.002+08:00</published><updated>2013-02-16T13:25:50.470+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ArcGIS Server"/><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><category scheme="http://www.blogger.com/atom/ns#" term="喜歡的事"/><title type='text'>我懂了的實踐！</title><content type='html'>&lt;a href=&quot;http://wangshifuola.blogspot.tw/2013/01/blog-post_25.html&quot;&gt;1月25日傍晚騎車回家時，突然想懂了一個其實很簡單的概念&lt;/a&gt;，一值沒有時間可以來實做看看，最後做了一個簡單的雛型，雖然離預想的成果似乎還有一段差距，而且有非常多額外跑出來的問題，但已經有了整個架構的核心部份，剩下來就是解決這些亂七八糟的問題、逐步完成架構上的模組與重構目前的核心。
&lt;br /&gt;
&lt;br /&gt;
整個構想只是想處理一個很單純的事情，就是做一個&quot;可能可以實際執行&quot;的dynamic layer離線架構，初步完成了種坐標與屬性查詢。
&lt;br /&gt;
&lt;br /&gt;
沒什麼意義的系統雛型圖：
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzuFCV-rE-myBG83PoQeNqpaqHhVEBP9vnB9hfMSWptrNh7fOmNKMtmPJqTAXeToHlM6d63IhyphenhyphenZpDUvoYikr1nJ1pZNgSjD4w52GZp1VlyDAARyeSpetd8-wxxRsuNfqcXc_k9-qtySq4/s1600/offline%E5%AF%A6%E5%81%9A.jpg&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzuFCV-rE-myBG83PoQeNqpaqHhVEBP9vnB9hfMSWptrNh7fOmNKMtmPJqTAXeToHlM6d63IhyphenhyphenZpDUvoYikr1nJ1pZNgSjD4w52GZp1VlyDAARyeSpetd8-wxxRsuNfqcXc_k9-qtySq4/s640/offline%E5%AF%A6%E5%81%9A.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
很多事情要說出來很難，要想出來很難，但是說完想完要捲起袖子做更難，說和想是個開始，但實踐也還是起頭的一部份；願成為一個能說點話、能想點事情但有手藝的老工匠。</content><link rel='replies' type='application/atom+xml' href='http://wangshifuola.blogspot.com/feeds/8154295329440383369/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://wangshifuola.blogspot.com/2013/02/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/8154295329440383369'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/8154295329440383369'/><link rel='alternate' type='text/html' href='http://wangshifuola.blogspot.com/2013/02/blog-post.html' title='我懂了的實踐！'/><author><name>ola的家</name><uri>http://www.blogger.com/profile/17489699564369049796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUnrwMn6IvUcuEcU6tWY-mlfvU1rZ3NW6EHCAesBaOiHpoDNeJhCgJty3EnJXTHPsjYR53NutZLnli4xiUs1S9da7RXeblHyEORnvbxTUKIYg_x5uU146P69PXmq_fLw/s220/IMG_0442.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzuFCV-rE-myBG83PoQeNqpaqHhVEBP9vnB9hfMSWptrNh7fOmNKMtmPJqTAXeToHlM6d63IhyphenhyphenZpDUvoYikr1nJ1pZNgSjD4w52GZp1VlyDAARyeSpetd8-wxxRsuNfqcXc_k9-qtySq4/s72-c/offline%E5%AF%A6%E5%81%9A.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-379527003650342663.post-7125531744175839165</id><published>2013-01-25T20:03:00.000+08:00</published><updated>2013-01-25T20:03:05.189+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="喜歡的事"/><title type='text'>阿~~~~我懂了~~~~~</title><content type='html'>最近跟人聊天時，我常常說：「很多事情做了才會在某些時刻激發其他的想法，如果我們一值不嘗試新的東西那麼你就放棄了這些可能突然蹦出來的想法」，就像學寫程式，難道你能肯定學寫vb6完全沒有幫助你更快瞭解asp.net嗎？學寫asp.net沒有幫助你更快學會Flex嗎？學寫Flex沒有影響在Java上的思維？學寫Java沒有讓Objective-C觸類旁通？某些成果常常是由很多事情的累積而成的。&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
但是上面這些跟這篇沒有很大的關係，我只是在騎車回家途中，突然產生一個因為下午測試而讓我現在異常興奮的想法，興奮到一邊騎車一邊突然大叫「阿~~~~我懂了啦~~~~~」&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
:DDDDDDDD&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
key:3 kind of service、small data、local identify
&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
這實在是很值得吃個羊肉盧慶祝一下。</content><link rel='replies' type='application/atom+xml' href='http://wangshifuola.blogspot.com/feeds/7125531744175839165/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://wangshifuola.blogspot.com/2013/01/blog-post_25.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/7125531744175839165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/7125531744175839165'/><link rel='alternate' type='text/html' href='http://wangshifuola.blogspot.com/2013/01/blog-post_25.html' title='阿~~~~我懂了~~~~~'/><author><name>ola的家</name><uri>http://www.blogger.com/profile/17489699564369049796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUnrwMn6IvUcuEcU6tWY-mlfvU1rZ3NW6EHCAesBaOiHpoDNeJhCgJty3EnJXTHPsjYR53NutZLnli4xiUs1S9da7RXeblHyEORnvbxTUKIYg_x5uU146P69PXmq_fLw/s220/IMG_0442.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-379527003650342663.post-4471876027351120403</id><published>2013-01-25T18:53:00.005+08:00</published><updated>2013-01-25T18:57:42.351+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ArcGIS Server"/><category scheme="http://www.blogger.com/atom/ns#" term="喜歡的事"/><title type='text'>ArcGIS Server JS API測試_client端以csv檔案格式於地圖上展點</title><content type='html'>一個突然蹦出來的會議，只好重新打開很久沒開啟的ASP.NET專案，開始對那些新增、刪除、修改的表單做一些很無趣又產量驚人的敲敲打打，但這樣無聊的東西實在是很難連續兩三天，所以今天下午決定挑一個之前有在想、又有趣、又切合目前需求的題目來測試一下，目標：&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #93c47d;&quot;&gt;以ArcGIS Server JavaScript API將client端的點資料展在圖面上，並且有簡單的屬性顯示。
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
看一下資料格式：
&lt;br /&gt;
&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/AVvXsEjVnO1v9HEGzikl7-Ro6e5Y0VkfABzVCOrYB21UlR5jzkTcRmalCPDPUDQDTR8VKImun1yx75iQfXoxElDhlOoryZ8IRFhPx9OendnmNUEsHtl3p4K9S3IeeN8kcfLcfiYcLzE94BIxl2c/s1600/js%25E5%25B1%2595%25E9%25BB%259E1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;53&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVnO1v9HEGzikl7-Ro6e5Y0VkfABzVCOrYB21UlR5jzkTcRmalCPDPUDQDTR8VKImun1yx75iQfXoxElDhlOoryZ8IRFhPx9OendnmNUEsHtl3p4K9S3IeeN8kcfLcfiYcLzE94BIxl2c/s400/js%25E5%25B1%2595%25E9%25BB%259E1.jpg&quot; width=&quot;344&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
成果：&lt;br /&gt;
&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/AVvXsEjCJztaD0ZdH4C7A9E22vBcs3FoafCualSNZ-L-gf9N1Nr_N7mXKg0Rv5rvPyzb9Fv_xyJGPgSttCj0LX4l_4MI9aBDmOeFxcWO7TRPFcWUZ0zDj-xc4O-i03HsZVTPROo2wa1S_ssUXZk/s1600/js%25E5%25B1%2595%25E9%25BB%259E2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;197&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCJztaD0ZdH4C7A9E22vBcs3FoafCualSNZ-L-gf9N1Nr_N7mXKg0Rv5rvPyzb9Fv_xyJGPgSttCj0LX4l_4MI9aBDmOeFxcWO7TRPFcWUZ0zDj-xc4O-i03HsZVTPROo2wa1S_ssUXZk/s400/js%25E5%25B1%2595%25E9%25BB%259E2.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
心得:&lt;br /&gt;
1. 測試1600點一次展繪大約1秒，拖動時的手感也還算順暢。&lt;br /&gt;
2. JavaScript真的不好維護，常常因為不小心的錯誤找很久。&lt;br /&gt;
3. 這樣的功能要能夠防呆，必須要非常嚴謹的程式碼。&lt;br /&gt;
4. 沒有回Server喔！  :D&lt;br /&gt;
5. 是一個感覺很有用的應用，你懂的，ㄎㄎ。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
本篇僅紀念js這麼弱的人，半天竟然測出小成果，但是下星期又要回到現實，繼續敲敲打打了。 :D&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://wangshifuola.blogspot.com/feeds/4471876027351120403/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://wangshifuola.blogspot.com/2013/01/arcgis-server-js-apiclientcsv.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/4471876027351120403'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/4471876027351120403'/><link rel='alternate' type='text/html' href='http://wangshifuola.blogspot.com/2013/01/arcgis-server-js-apiclientcsv.html' title='ArcGIS Server JS API測試_client端以csv檔案格式於地圖上展點'/><author><name>ola的家</name><uri>http://www.blogger.com/profile/17489699564369049796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUnrwMn6IvUcuEcU6tWY-mlfvU1rZ3NW6EHCAesBaOiHpoDNeJhCgJty3EnJXTHPsjYR53NutZLnli4xiUs1S9da7RXeblHyEORnvbxTUKIYg_x5uU146P69PXmq_fLw/s220/IMG_0442.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVnO1v9HEGzikl7-Ro6e5Y0VkfABzVCOrYB21UlR5jzkTcRmalCPDPUDQDTR8VKImun1yx75iQfXoxElDhlOoryZ8IRFhPx9OendnmNUEsHtl3p4K9S3IeeN8kcfLcfiYcLzE94BIxl2c/s72-c/js%25E5%25B1%2595%25E9%25BB%259E1.jpg" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-379527003650342663.post-1738454700613716079</id><published>2013-01-17T21:41:00.000+08:00</published><updated>2013-01-28T00:23:24.864+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="喜歡的事"/><title type='text'>六週年慶</title><content type='html'>六週年，以accepted開頭，勢必需要一個有氣勢的延續，取名在家也可以享受高級餐廳的服務大作戰！&lt;br /&gt;
&lt;br /&gt;
前菜：洋蔥燻鮭魚&lt;br /&gt;
&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/AVvXsEh8AumzVwE7VHxkVCZZahpaujtG5GkiEnuN3l9x56OduzT3YBbL0dKPKE48CgkqCHa2av58zOGwvhUOXkWUCvaTOmo7V0xU0EOi3C3vOLcncP371kI4kV29UuP8pcbUFw09B0pr48xa-4k/s1600/IMG_3639.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8AumzVwE7VHxkVCZZahpaujtG5GkiEnuN3l9x56OduzT3YBbL0dKPKE48CgkqCHa2av58zOGwvhUOXkWUCvaTOmo7V0xU0EOi3C3vOLcncP371kI4kV29UuP8pcbUFw09B0pr48xa-4k/s400/IMG_3639.jpg&quot; height=&quot;400&quot; width=&quot;300&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
配菜：白酒蛤蜊+香炒野菇&lt;br /&gt;
&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/AVvXsEg1mLJAt2golkAvFt72_Xr0Q3okTTFIOBN_SkZHgTv0Phm114B8ySUPCV2u5Mq-ctsmnWFJrDJu_YxWxIaM2l59YVZAH4f4A8ImsEepi4QnHn3qdIZZ0eOM0UKtJiH8mYhRx_9DeqawuOw/s1600/IMG_3654.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1mLJAt2golkAvFt72_Xr0Q3okTTFIOBN_SkZHgTv0Phm114B8ySUPCV2u5Mq-ctsmnWFJrDJu_YxWxIaM2l59YVZAH4f4A8ImsEepi4QnHn3qdIZZ0eOM0UKtJiH8mYhRx_9DeqawuOw/s400/IMG_3654.jpg&quot; height=&quot;300&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
湯品：海鮮濃湯&lt;br /&gt;
&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/AVvXsEjP9bNUrhrZ1et5Uc3S_8Sn2tzhcVb-2Q-huAmdA-0TndmLnae9qdU7WsSI16V9kwoCfITYhJ6y2H-TiIjBIGnrvQyfBkqrDaQEeu9R8f-DDC7Hq0cqXCai3Y5HECg8TjXdRJJjQlDgf-Q/s1600/IMG_3656.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjP9bNUrhrZ1et5Uc3S_8Sn2tzhcVb-2Q-huAmdA-0TndmLnae9qdU7WsSI16V9kwoCfITYhJ6y2H-TiIjBIGnrvQyfBkqrDaQEeu9R8f-DDC7Hq0cqXCai3Y5HECg8TjXdRJJjQlDgf-Q/s400/IMG_3656.jpg&quot; height=&quot;400&quot; width=&quot;300&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
麵包：法式吐司&lt;br /&gt;
&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/AVvXsEiWisKyNqLcDVVQXC4ps0w-e0PpHFg8ouHMV0-SD3cBVvjZvVNe9OTxgZE4379Dw0BAqBCAM9QSwRAPjptKtDUR3EjuXuVZvlzmy9vXfdkqaZnYEJY_HGINRvkfmvBUJ5wXpflrX616v50/s1600/IMG_3662.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWisKyNqLcDVVQXC4ps0w-e0PpHFg8ouHMV0-SD3cBVvjZvVNe9OTxgZE4379Dw0BAqBCAM9QSwRAPjptKtDUR3EjuXuVZvlzmy9vXfdkqaZnYEJY_HGINRvkfmvBUJ5wXpflrX616v50/s400/IMG_3662.jpg&quot; height=&quot;400&quot; width=&quot;300&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
主菜：香煎羊排&lt;br /&gt;
&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/AVvXsEh9VLegrOel56uM9As7CVgy6lFtsvumsly2B7hMaNWnPtDus-n0OgHSQl3L6idDj-p1fKeuaB3mV-GbPihvz7shhGp5zMaKmqECXCuU84Tr7KeVdJT8q5B97NyG75tIxbF5A1vWrAFny4o/s1600/IMG_3668.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9VLegrOel56uM9As7CVgy6lFtsvumsly2B7hMaNWnPtDus-n0OgHSQl3L6idDj-p1fKeuaB3mV-GbPihvz7shhGp5zMaKmqECXCuU84Tr7KeVdJT8q5B97NyG75tIxbF5A1vWrAFny4o/s400/IMG_3668.jpg&quot; height=&quot;300&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
飲料：蘋果冰茶&lt;br /&gt;
&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/AVvXsEgQWkDiFGDz7xGQwQfQzdryeTykgM4iB-Z7wsP3X9zVYmuCyRhvIOta3_YW299T1zbccAzOl-icANA1xmVlVFJBtgibj9dlzMEVSJcn_DsW0EnXZxdKC-KWyS21E2D23vQKmZGjd3JbFB0/s1600/IMG_3692.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQWkDiFGDz7xGQwQfQzdryeTykgM4iB-Z7wsP3X9zVYmuCyRhvIOta3_YW299T1zbccAzOl-icANA1xmVlVFJBtgibj9dlzMEVSJcn_DsW0EnXZxdKC-KWyS21E2D23vQKmZGjd3JbFB0/s400/IMG_3692.jpg&quot; height=&quot;300&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
甜點：香蕉布朗尼&lt;br /&gt;
&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/AVvXsEj0lgC20jBhOaguWiXsSk4P7FL_c6fCjgjk9h9fuxKi7cAlQB_WNTnDb2a12am6dL3kdBHetDQJmIlboiuoJ8bK_AJmVAF8P2X27evAQKWQhdBKP3ufTkA6AT8_G7h4mgpvIBsEFWgb3uY/s1600/IMG_3696.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0lgC20jBhOaguWiXsSk4P7FL_c6fCjgjk9h9fuxKi7cAlQB_WNTnDb2a12am6dL3kdBHetDQJmIlboiuoJ8bK_AJmVAF8P2X27evAQKWQhdBKP3ufTkA6AT8_G7h4mgpvIBsEFWgb3uY/s400/IMG_3696.jpg&quot; height=&quot;300&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
六週年快樂。
&lt;br /&gt;
&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/AVvXsEg3FKc_kuZQs76Ge6_wgn9fif6y-fgfGCLVNKdmRU2AvLFJjFs9NZ8Xxzqc_izTdx1rxqAVkmu-dqWgiqty1wA-2zaJ6IXWl7i-Ir0p3xuIwr_21gbU9s3Rqa6ChYswm3fs3D0C3L1wtZE/s1600/IMG_3619.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3FKc_kuZQs76Ge6_wgn9fif6y-fgfGCLVNKdmRU2AvLFJjFs9NZ8Xxzqc_izTdx1rxqAVkmu-dqWgiqty1wA-2zaJ6IXWl7i-Ir0p3xuIwr_21gbU9s3Rqa6ChYswm3fs3D0C3L1wtZE/s400/IMG_3619.jpg&quot; height=&quot;400&quot; width=&quot;300&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://wangshifuola.blogspot.com/feeds/1738454700613716079/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://wangshifuola.blogspot.com/2013/01/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/1738454700613716079'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/1738454700613716079'/><link rel='alternate' type='text/html' href='http://wangshifuola.blogspot.com/2013/01/blog-post.html' title='六週年慶'/><author><name>ola的家</name><uri>http://www.blogger.com/profile/17489699564369049796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUnrwMn6IvUcuEcU6tWY-mlfvU1rZ3NW6EHCAesBaOiHpoDNeJhCgJty3EnJXTHPsjYR53NutZLnli4xiUs1S9da7RXeblHyEORnvbxTUKIYg_x5uU146P69PXmq_fLw/s220/IMG_0442.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8AumzVwE7VHxkVCZZahpaujtG5GkiEnuN3l9x56OduzT3YBbL0dKPKE48CgkqCHa2av58zOGwvhUOXkWUCvaTOmo7V0xU0EOi3C3vOLcncP371kI4kV29UuP8pcbUFw09B0pr48xa-4k/s72-c/IMG_3639.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-379527003650342663.post-3932711987264812197</id><published>2013-01-11T16:02:00.000+08:00</published><updated>2013-03-22T10:27:55.960+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><title type='text'>Android學習_如何開始使用Google Maps Android API v2</title><content type='html'>前一陣子想要測試一些Google Map的東西，才發現他默默的在2012年12月3日推出了Google Maps Android API v2(&lt;a href=&quot;https://developers.google.com/maps/documentation/android/&quot;&gt;官方資料&lt;/a&gt;)，而原本申請key與使用的方式變的不太一樣。&lt;br /&gt;
&lt;br /&gt;
要讓手機正確出現Google map需要下列步驟：&lt;br /&gt;
1. 建立個人的keystore。&lt;br /&gt;
2. 由個人的keystore查詢SHA1碼。&lt;br /&gt;
3. 利用SHA1碼至&lt;a href=&quot;https://code.google.com/apis/console/&quot;&gt;Google apis網站&lt;/a&gt;申請key。&lt;br /&gt;
4. 於eclipse安裝Google Play services。&lt;br /&gt;
5. 於要使用Google Map的專案加入google-play-services_lib的Library。&lt;br /&gt;
6. 於專案的AndroidManifest與layout.mal加入需要的設定。&lt;br /&gt;
7. 利用第一步驟的keystore匯出專案為apk檔案。&lt;br /&gt;
8. 以adb安裝上述apk檔案。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
詳細步驟：&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #93c47d;&quot;&gt;1. 建立個人的keystore。&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
A. 開啟DOS命令視窗，找到java的bin資料夾(C:\Program Files\Java\jre6\bin)&lt;br /&gt;
B. 輸入keytool指令(keytool -genkey -v -keystore yourkeyname.keystore -alias yourkeyname -keyalg RSA -keysize 2048 -validity 10000)&lt;br /&gt;
輸入後，會有一系列的問題，需要注意的是過程中會輸入兩種密碼，網路上書上都推薦怕記不住就用一樣。&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8uIcOcSd220taYR-VdwVsBNx-ixBCOF-iGx1IwwX0aRXrLwPdfYdrsD8N56VB25qBohXZ4n0vQuQLeXqrdcVWgRkiCPyelfZUgOoaamWAIx2ljyWCGFKIKWHnCPkiK1qgx9OfnARtlF0/s1600/GMapkey_%25E5%25AF%25A6%25E6%25A9%259F1.PNG&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5675763515386531106&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8uIcOcSd220taYR-VdwVsBNx-ixBCOF-iGx1IwwX0aRXrLwPdfYdrsD8N56VB25qBohXZ4n0vQuQLeXqrdcVWgRkiCPyelfZUgOoaamWAIx2ljyWCGFKIKWHnCPkiK1qgx9OfnARtlF0/s400/GMapkey_%25E5%25AF%25A6%25E6%25A9%259F1.PNG&quot; style=&quot;cursor: hand; cursor: pointer; display: block; height: 307px; margin: 0px auto 10px; text-align: center; width: 400px;&quot; /&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #93c47d;&quot;&gt;2. 由個人的keystore查詢SHA1碼。&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
A. 還是一樣先開啟DOS命令視窗，找到java的bin資料夾(C:\Program Files\Java\jre6\bin)&lt;br /&gt;
B. 使用&quot;既有keystore取得SHA1的語法(keytool -list -v -keystore &quot;C:\Program Files\Java\jre6\bin\yourkeyname.keystore&quot;)，鍵入語法後就必須要輸入剛剛建立時所設定的密碼。(語法中加上-v才會顯示SHA1碼)&lt;br /&gt;
&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/AVvXsEiQWiqFnLKtVDyMSw_jWGVP8WzUpGF4yFrrHcB82pWo0q-tYaDdzVIbyTKY6tJmblH_8SFoahmhI6pEUzGU_wy9wlOtSgq8GLTmtcvnbQ72qBnetlWLuhSYUx_Ru0Gb7Jsj89T6g5rCrmM/s1600/key%25E7%2594%25A2%25E7%2594%259F2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;264&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQWiqFnLKtVDyMSw_jWGVP8WzUpGF4yFrrHcB82pWo0q-tYaDdzVIbyTKY6tJmblH_8SFoahmhI6pEUzGU_wy9wlOtSgq8GLTmtcvnbQ72qBnetlWLuhSYUx_Ru0Gb7Jsj89T6g5rCrmM/s400/key%25E7%2594%25A2%25E7%2594%259F2.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #93c47d;&quot;&gt;&lt;b&gt;3. 利用SHA1碼至&lt;/b&gt;&lt;/span&gt;&lt;a href=&quot;https://code.google.com/apis/console/&quot;&gt;Google apis網站&lt;/a&gt;&lt;span style=&quot;color: #93c47d;&quot;&gt;&lt;b&gt;申請key。&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
A. 連至申請網站https://code.google.com/apis/console/ &lt;br /&gt;
B. 若是第一次使用按Create Project。&lt;br /&gt;
&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/AVvXsEiBqqd7f3lh-M3_99_5iQknqrsfXhhIDkiN0-Jy2ZV34iGmKn6i8rfG4FJ7v57C3p5WX6mgKtKC3IRW4II6FkabMCAqXJ-kiUX4apDMeOmRNvJcMKxMthc-uaY_T-bpPLfTGoofHbCp9B8/s1600/%25E5%25B0%2588%25E6%25A1%2588%25E7%2594%25B3%25E8%25AB%258B1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;360&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBqqd7f3lh-M3_99_5iQknqrsfXhhIDkiN0-Jy2ZV34iGmKn6i8rfG4FJ7v57C3p5WX6mgKtKC3IRW4II6FkabMCAqXJ-kiUX4apDMeOmRNvJcMKxMthc-uaY_T-bpPLfTGoofHbCp9B8/s400/%25E5%25B0%2588%25E6%25A1%2588%25E7%2594%25B3%25E8%25AB%258B1.jpg&quot; width=&quot;391&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
C. 選擇左邊列表的Services，並且將google Maps Android API v2調整成&quot;on&quot;。&lt;br /&gt;
&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/AVvXsEjaLlFQKAU8kSQf29bi9tptlaaEdOIiBZywp9igd84EK-D5KCAam6FOBZOKSOH9UwewF5jDTI-UOb_d4e6uKtxoMq0DBSxDfLR4qmu5871fb1SQH8Nnkkjrm3w5iDr_qQDl1gOHDTc2PXM/s1600/%25E5%25B0%2588%25E6%25A1%2588%25E7%2594%25B3%25E8%25AB%258B1_2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;251&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaLlFQKAU8kSQf29bi9tptlaaEdOIiBZywp9igd84EK-D5KCAam6FOBZOKSOH9UwewF5jDTI-UOb_d4e6uKtxoMq0DBSxDfLR4qmu5871fb1SQH8Nnkkjrm3w5iDr_qQDl1gOHDTc2PXM/s400/%25E5%25B0%2588%25E6%25A1%2588%25E7%2594%25B3%25E8%25AB%258B1_2.jpg&quot; width=&quot;204&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&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/AVvXsEg4HmdsfLX00gey6Oq0AzfjGMr-Y7I3w2rZgUSIv_IQlAI0nw-AV8vN_M25MyjRBo-RwJaKVGIOTEOPYtuVrfwgtcNNyvTYPo0lgV9YRgixAfUri7f8tZtQa6UJi7UmxNle6YM6h6-McQg/s1600/%25E5%25B0%2588%25E6%25A1%2588%25E7%2594%25B3%25E8%25AB%258B2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;45&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4HmdsfLX00gey6Oq0AzfjGMr-Y7I3w2rZgUSIv_IQlAI0nw-AV8vN_M25MyjRBo-RwJaKVGIOTEOPYtuVrfwgtcNNyvTYPo0lgV9YRgixAfUri7f8tZtQa6UJi7UmxNle6YM6h6-McQg/s400/%25E5%25B0%2588%25E6%25A1%2588%25E7%2594%25B3%25E8%25AB%258B2.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
D. 選擇左邊列表的API Access，並且點擊右下角的Create new Android key。&lt;br /&gt;
&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/AVvXsEi5Qo9FlOsWp1oeGxHUQdL4am6nGHan2QYNMDpobLSz852VDLf1gJVTZk6JmM5FihFf_uP0X1P9stNe8EBdkf2RYkxOuTacaa3iGwj7lUA2yDI5cLgVazp6eCyU3QvblJw2Se8gyINjJNc/s1600/%25E5%25B0%2588%25E6%25A1%2588%25E7%2594%25B3%25E8%25AB%258B3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;264&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5Qo9FlOsWp1oeGxHUQdL4am6nGHan2QYNMDpobLSz852VDLf1gJVTZk6JmM5FihFf_uP0X1P9stNe8EBdkf2RYkxOuTacaa3iGwj7lUA2yDI5cLgVazp6eCyU3QvblJw2Se8gyINjJNc/s400/%25E5%25B0%2588%25E6%25A1%2588%25E7%2594%25B3%25E8%25AB%258B3.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
E. 輸入步驟二得到的SHA1與專案的Package名稱(中間以分號分隔)，例：SHA1碼;tw.com.maptest。&lt;br /&gt;
&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/AVvXsEiPwdOOwBIfjZGFvd-SRk-ZHg2DvYla2yMTE2p4Q-xxeHCs_SnEVesZ7fNnO7UfyqRab09vu5mdNXWY8FQKsmzK4oI2WZ6sf3qdv8uNHqc_-uRnqga9ycj3E5-QZ8aqIXBEPo4dVzsCeoo/s1600/%25E5%25B0%2588%25E6%25A1%2588%25E7%2594%25B3%25E8%25AB%258B4.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;277&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPwdOOwBIfjZGFvd-SRk-ZHg2DvYla2yMTE2p4Q-xxeHCs_SnEVesZ7fNnO7UfyqRab09vu5mdNXWY8FQKsmzK4oI2WZ6sf3qdv8uNHqc_-uRnqga9ycj3E5-QZ8aqIXBEPo4dVzsCeoo/s400/%25E5%25B0%2588%25E6%25A1%2588%25E7%2594%25B3%25E8%25AB%258B4.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
F. 記住API key。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #93c47d;&quot;&gt;&lt;b&gt;4. 於eclipse安裝Google Play services。&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
A. 進入Android SDK Mnanger(eclipse→windows→Android SDK Mnanger)。&lt;br /&gt;
B. 安裝Extras的Google Play services。&lt;br /&gt;
&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/AVvXsEgoJQrgEHh2hKfDS4k7WgfvXTaax6gC18drvMdDrG9r8U5DvUTWyeBjcQ2vGCA652crOm2aXmMlS5KXmYy7L469ChndP-Q72YYQ5Pp4Fa84uNb8clxEF_ApQ325Wh5AHQIYXsbjVSQ9BU0/s1600/%25E7%2592%25B0%25E5%25A2%2583%25E8%25A8%25AD%25E5%25AE%259A2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;287&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoJQrgEHh2hKfDS4k7WgfvXTaax6gC18drvMdDrG9r8U5DvUTWyeBjcQ2vGCA652crOm2aXmMlS5KXmYy7L469ChndP-Q72YYQ5Pp4Fa84uNb8clxEF_ApQ325Wh5AHQIYXsbjVSQ9BU0/s400/%25E7%2592%25B0%25E5%25A2%2583%25E8%25A8%25AD%25E5%25AE%259A2.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #93c47d;&quot;&gt;5. 於要使用Google Map的專案加入google-play-services_lib的Library。&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
A. 於eclipse→File→import，選擇Android下的Existing Android Code Into Workspace。&lt;br /&gt;
&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/AVvXsEh4Htnat2ZglicLT0HZfEINe3j7Huzydku6aJNAg5teREpxA_ZdTQjVV2BqKvRW_PAqkjZ1MXFPqjJmZV04HPVA7b48XLU2UZ8MizSZ4zgLv-rvdpgGUoQaiZfqeLHhy5e6VfFVKC6df74/s1600/prj%25E5%25BB%25BA%25E7%25BD%25AE4.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4Htnat2ZglicLT0HZfEINe3j7Huzydku6aJNAg5teREpxA_ZdTQjVV2BqKvRW_PAqkjZ1MXFPqjJmZV04HPVA7b48XLU2UZ8MizSZ4zgLv-rvdpgGUoQaiZfqeLHhy5e6VfFVKC6df74/s400/prj%25E5%25BB%25BA%25E7%25BD%25AE4.jpg&quot; width=&quot;380&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
B. 由Browse選擇→[android-sdk-folder]/extras/google/google_play_services/libproject/google-play-services_lib&lt;br /&gt;
C. 於要使用Google Map的專案按右鍵，選擇Properties。於左側選單選擇Android，並於下方Library上述加入的專案google-play-services_lib。&lt;br /&gt;
&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/AVvXsEgJxy4_9tsNaavmDwfdtTLTsYB-6v_2DR4NH71hdK5-YcYuQrBb_ZXxPfAKOTlkypj5eHCH-WcZpzZu4EhU7p27RfBPvXPrgLXZQUcSOLNWFpPy_iF580qt7qEfm5gKOzFNVNORqWoyLl8/s1600/prj%25E5%25BB%25BA%25E7%25BD%25AE3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;377&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJxy4_9tsNaavmDwfdtTLTsYB-6v_2DR4NH71hdK5-YcYuQrBb_ZXxPfAKOTlkypj5eHCH-WcZpzZu4EhU7p27RfBPvXPrgLXZQUcSOLNWFpPy_iF580qt7qEfm5gKOzFNVNORqWoyLl8/s400/prj%25E5%25BB%25BA%25E7%25BD%25AE3.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #93c47d;&quot;&gt;&lt;b&gt;6. 於專案的AndroidManifest與layout.xml加入需要的設定。&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
A. 打開AndroidManifest加入必須的設定。&lt;br /&gt;
於application標籤之上(注意下述程式碼必須置換yourpackagename成你的package名稱)：&lt;br /&gt;
&lt;code&gt;
&amp;lt;permission android:name=&quot;yourpackagename.permission.MAPS_RECEIVE&quot; android:protectionLevel=&quot;signature&quot;/&amp;gt;
 &amp;lt;uses-permission android:name=&quot;yourpackagename.permission.MAPS_RECEIVE&quot;/&amp;gt;
 &amp;lt;uses-permission android:name=&quot;android.permission.INTERNET&quot;/&amp;gt;
 &amp;lt;uses-permission android:name=&quot;android.permission.WRITE_EXTERNAL_STORAGE&quot;/&amp;gt;
 &amp;lt;uses-permission android:name=&quot;com.google.android.providers.gsf.permission.READ_GSERVICES&quot;/&amp;gt;
 &amp;lt;uses-permission android:name=&quot;android.permission.ACCESS_COARSE_LOCATION&quot;/&amp;gt;
 &amp;lt;uses-permission android:name=&quot;android.permission.ACCESS_FINE_LOCATION&quot;/&amp;gt;
&lt;/code&gt;
&lt;br /&gt;
於application標籤中加入(注意下述程式碼必須置換GoogleMapAPIKey成剛剛申請到的Key)：&lt;br /&gt;
&lt;code&gt;
&amp;lt;meta-data android:name=&quot;com.google.android.maps.v2.API_KEY&quot; android:value=&quot;GoogleMapAPIKey&quot;/&amp;gt;
&lt;/code&gt;
&lt;br /&gt;
於application標籤下加入：&lt;br /&gt;
&lt;code&gt;
&amp;lt;uses-feature android:glEsVersion=&quot;0x00020000&quot; android:required=&quot;true&quot; /&amp;gt;
&lt;/code&gt;
&lt;br /&gt;
B. 打開layout.xml，將介面先改為較單純的內容，待測試OK後再更改為自己需要的介面。&lt;br /&gt;
&lt;code&gt;
&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;fragment xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
  android:id=&quot;@+id/map&quot;
  android:layout_width=&quot;match_parent&quot;
  android:layout_height=&quot;match_parent&quot;
  class=&quot;com.google.android.gms.maps.MapFragment&quot;/&amp;gt;
&lt;/code&gt;
&lt;br /&gt;
C. java用最單純的內容先進行測試：
&lt;code&gt;
package yourpackageName;
import android.os.Bundle;
import android.app.Activity;
public class MainActivity extends Activity {

 @Override
 protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
 }

}
&lt;/code&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #93c47d;&quot;&gt;&lt;b&gt;7. 利用第一步驟的keystore匯出專案為apk檔案。&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
A. 專案右鍵選擇Android Tools→Export Signed Application Package。&lt;br /&gt;
B. 依照步驟可以匯出帶有簽章的apk檔案(過程中必須輸入最初設定的keystore密碼)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #93c47d;&quot;&gt;&lt;b&gt;8. 以adb安裝上述apk檔案。&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
A. 利用adb指令(adb install Name.apk)&lt;br /&gt;
&lt;br /&gt;
最後，執行程式，確認手機有連上網路，迎接你的地圖吧。&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #93c47d;&quot;&gt;&lt;b&gt;這篇有幫助到你了話，請留&quot;&lt;u&gt;&lt;i&gt;YA~~~看到圖了&lt;/i&gt;&lt;/u&gt;&quot;&lt;/b&gt;&lt;/span&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;span style=&quot;color: #93c47d;&quot;&gt;&lt;b&gt;2013年3月22日由劉佺網友補充如何在不匯出專案的情況下，使用debug.keystore來進行實機測試：&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
以下為完整留言，感謝他的補充：
&lt;br/&gt;
不過隨即發現不用匯出成apk這麼麻煩，如果用他預設的debug.keystore去產生api key，就可以直接從eclipse/Run As去選擇自己的裝置&lt;br/&gt;

預設的debug.keystore可以從Preferences \ Android \ Build \ Default debug keystore去查詢&lt;br/&gt;
步驟二的語法就會變成：keytool -list -v -keystore &quot;C:\Users\使用者名稱\.android\debug.keystore&quot;&lt;br/&gt;
預設的debug.keystore的預設密碼是：android；這樣去申請，DEBUG時測試起來就會比較快(非常多 XD)，就不用每次都匯出成專案了&lt;br/&gt;
&lt;br/&gt;
剛才測試的時候發現，申請完以後，如果要改成自己之前新建的keystore&lt;br/&gt;
1. 先查自定密碼的keystore的SHA1碼&lt;br/&gt;
2. 到Google的API Access分頁&lt;br/&gt;
3. 選擇右邊的Edit allowed Android apps...&lt;br/&gt;
4. 將前半的SHA1碼改掉，分號後面的專案名稱不動&lt;br/&gt;
結果API key也不會變動，匯出專案時就可以用自訂的密碼了&lt;br/&gt;
實際安裝起來Google Map也可以正常顯示&lt;br/&gt;
----------------------------------------------------------------</content><link rel='replies' type='application/atom+xml' href='http://wangshifuola.blogspot.com/feeds/3932711987264812197/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://wangshifuola.blogspot.com/2013/01/androidgoogle-maps-android-api-v2.html#comment-form' title='90 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/3932711987264812197'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/3932711987264812197'/><link rel='alternate' type='text/html' href='http://wangshifuola.blogspot.com/2013/01/androidgoogle-maps-android-api-v2.html' title='Android學習_如何開始使用Google Maps Android API v2'/><author><name>ola的家</name><uri>http://www.blogger.com/profile/17489699564369049796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUnrwMn6IvUcuEcU6tWY-mlfvU1rZ3NW6EHCAesBaOiHpoDNeJhCgJty3EnJXTHPsjYR53NutZLnli4xiUs1S9da7RXeblHyEORnvbxTUKIYg_x5uU146P69PXmq_fLw/s220/IMG_0442.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8uIcOcSd220taYR-VdwVsBNx-ixBCOF-iGx1IwwX0aRXrLwPdfYdrsD8N56VB25qBohXZ4n0vQuQLeXqrdcVWgRkiCPyelfZUgOoaamWAIx2ljyWCGFKIKWHnCPkiK1qgx9OfnARtlF0/s72-c/GMapkey_%25E5%25AF%25A6%25E6%25A9%259F1.PNG" height="72" width="72"/><thr:total>90</thr:total></entry><entry><id>tag:blogger.com,1999:blog-379527003650342663.post-3036742743687263791</id><published>2013-01-10T15:39:00.000+08:00</published><updated>2013-01-10T15:39:26.877+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>SQL_程式無法連線到SQL Server相關問題排解</title><content type='html'>在裝機時其中一個很重要的事情，就是確認程式是否可以正確連線到資料庫，若是無法正常連線，可以逐步測試來確認有可能出問題的設定：
&lt;br /&gt;
&lt;br /&gt;
0. 確認輸入之伺服器名稱正確，包含安裝兩台以上之SQL Server是否有增加實體名稱(伺服器/實體名稱)&lt;br /&gt;
&lt;br /&gt;
1. 以本機確認Windows驗證(伺服器/實體名稱)是否可以通過：若是無法通過，應確認SQL Server在安裝時的管理者是否還存在於windows帳號當中，若原設定的管理者被刪除，唯有重建資料庫與重灌一途。&lt;br /&gt;
&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/AVvXsEhNseVLrcqKD1hXSn7s79TIbRISMZq05xfivu5rbWNlsA-kDrHpALygpgi_oDRQRvhW7Cfg6UawXkRzFpL-NYVWPsMAPX0fSgbs6X-cPjNw6Kdu3xkO3I3ZRwT8Wt63hn6TisQDetyEnRQ/s1600/%25E7%25A8%258B%25E5%25BC%258F%25E9%2580%25A3SQL%25E5%2595%258F%25E9%25A1%258C%25E6%258E%2592%25E8%25A7%25A30.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNseVLrcqKD1hXSn7s79TIbRISMZq05xfivu5rbWNlsA-kDrHpALygpgi_oDRQRvhW7Cfg6UawXkRzFpL-NYVWPsMAPX0fSgbs6X-cPjNw6Kdu3xkO3I3ZRwT8Wt63hn6TisQDetyEnRQ/s400/%25E7%25A8%258B%25E5%25BC%258F%25E9%2580%25A3SQL%25E5%2595%258F%25E9%25A1%258C%25E6%258E%2592%25E8%25A7%25A30.jpg&quot; height=&quot;360&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
2. 以本機確認SQL驗證(伺服器/實體名稱)是否可以通過：若是無法通過，請用管理者帳號確認該SQL帳號是否已於安全性的登入中正確顯示。&lt;br /&gt;
&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/AVvXsEh81PXz8avQ-vNIe63n1fJbbN-jk7fp5eAXOCU44oTPl0sr6juqoO7N8qdzzMY5Hcaw302SB9xlptIoH1ocjCAQU2TePt8ZTz22-xpKWrdWFdZih1CUwV2GmPBNhIbBJJ5N1PPIiRi-MyM/s1600/%25E7%25A8%258B%25E5%25BC%258F%25E9%2580%25A3SQL%25E5%2595%258F%25E9%25A1%258C%25E6%258E%2592%25E8%25A7%25A32.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh81PXz8avQ-vNIe63n1fJbbN-jk7fp5eAXOCU44oTPl0sr6juqoO7N8qdzzMY5Hcaw302SB9xlptIoH1ocjCAQU2TePt8ZTz22-xpKWrdWFdZih1CUwV2GmPBNhIbBJJ5N1PPIiRi-MyM/s400/%25E7%25A8%258B%25E5%25BC%258F%25E9%2580%25A3SQL%25E5%2595%258F%25E9%25A1%258C%25E6%258E%2592%25E8%25A7%25A32.jpg&quot; height=&quot;319&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
且確認該資料庫是否設定為&quot;SQL Server及Windows驗證模式。&lt;br /&gt;
&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/AVvXsEifT-gFoNiAfLaIqMCnAsIW34rsnNS4GdPlJUo2iHEwbDZg9OLlvNfe3doLDv-6EUw9q1fNaUtY66ky4i-OfNO9tV6P7RuvXS6cp5acaeD6KgEs2yAQlpsQ22OZsChF-yJDNUtAz4CD97s/s1600/%25E7%25A8%258B%25E5%25BC%258F%25E9%2580%25A3SQL%25E5%2595%258F%25E9%25A1%258C%25E6%258E%2592%25E8%25A7%25A3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifT-gFoNiAfLaIqMCnAsIW34rsnNS4GdPlJUo2iHEwbDZg9OLlvNfe3doLDv-6EUw9q1fNaUtY66ky4i-OfNO9tV6P7RuvXS6cp5acaeD6KgEs2yAQlpsQ22OZsChF-yJDNUtAz4CD97s/s400/%25E7%25A8%258B%25E5%25BC%258F%25E9%2580%25A3SQL%25E5%2595%258F%25E9%25A1%258C%25E6%258E%2592%25E8%25A7%25A3.jpg&quot; height=&quot;400&quot; width=&quot;362&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
3. 以本機確認SQL驗證(ip/實體名稱)是否可以通過：若是無法通過，至SQL Server組態管理員確認是否有開啟TCP/IP設定。&lt;br /&gt;
&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/AVvXsEjH_VTXsYUuU6S6RwtPVB45Xa3zJraSHto2xkKnceDr5y6JsFTc6iFJnhEezM_tHW8XGGepOLSxroEF1cEm7FhSJmNG_uBnsxWfW3Ko1g9YgG3HnQwMGuse9MKZdS6IvkjbJUXfGlqjVHc/s1600/%25E7%25A8%258B%25E5%25BC%258F%25E9%2580%25A3SQL%25E5%2595%258F%25E9%25A1%258C%25E6%258E%2592%25E8%25A7%25A33.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjH_VTXsYUuU6S6RwtPVB45Xa3zJraSHto2xkKnceDr5y6JsFTc6iFJnhEezM_tHW8XGGepOLSxroEF1cEm7FhSJmNG_uBnsxWfW3Ko1g9YgG3HnQwMGuse9MKZdS6IvkjbJUXfGlqjVHc/s400/%25E7%25A8%258B%25E5%25BC%258F%25E9%2580%25A3SQL%25E5%2595%258F%25E9%25A1%258C%25E6%258E%2592%25E8%25A7%25A33.jpg&quot; height=&quot;147&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
4. 以本機確認驗證通過後，是否可以正常開啟要查詢的資料庫：若是跳出無法存取資料庫XXX，則確認該SQL帳號是否有給定存取該資料庫之權限。&lt;br /&gt;
&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/AVvXsEhMNk0TtIosMd9YXj4NJLfIKGiKD_InouZ8sYOJgY9tW-KPaMhGZu9O5gOEBi3-erV68nmfLZZPtSX3u-e_qGCMnU7mY0VSiX-Tvkt-f2RMv92hxvzXUGzvuuPLpOd92Dm7flnL3r7dMOg/s1600/%25E7%25A8%258B%25E5%25BC%258F%25E9%2580%25A3SQL%25E5%2595%258F%25E9%25A1%258C%25E6%258E%2592%25E8%25A7%25A35.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMNk0TtIosMd9YXj4NJLfIKGiKD_InouZ8sYOJgY9tW-KPaMhGZu9O5gOEBi3-erV68nmfLZZPtSX3u-e_qGCMnU7mY0VSiX-Tvkt-f2RMv92hxvzXUGzvuuPLpOd92Dm7flnL3r7dMOg/s400/%25E7%25A8%258B%25E5%25BC%258F%25E9%2580%25A3SQL%25E5%2595%258F%25E9%25A1%258C%25E6%258E%2592%25E8%25A7%25A35.jpg&quot; height=&quot;400&quot; width=&quot;361&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
5. 以另一台伺服器測試SQL驗證(ip/實體名稱)，若無法連線：&lt;br /&gt;
(1) 至SQL Server組態管理員查看ip設定為何？若有指定之port，連線時必須以&quot;ip/實體名稱,port&quot;來連線。
&lt;br /&gt;
&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/AVvXsEgpoj9a7sNvMIPoILCCltevu-V05wJnyQj9AwxHhFDbmAyhWvd3tc7a0R2R_X02f9eR6Je7FpaHp9WcjiKAgvj9BJpa0XkKLV9gwHLWPmjOYSlQaa6h_WYw63mL6XKUG-uf18eqglnrCJA/s1600/%25E7%25A8%258B%25E5%25BC%258F%25E9%2580%25A3SQL%25E5%2595%258F%25E9%25A1%258C%25E6%258E%2592%25E8%25A7%25A36.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpoj9a7sNvMIPoILCCltevu-V05wJnyQj9AwxHhFDbmAyhWvd3tc7a0R2R_X02f9eR6Je7FpaHp9WcjiKAgvj9BJpa0XkKLV9gwHLWPmjOYSlQaa6h_WYw63mL6XKUG-uf18eqglnrCJA/s400/%25E7%25A8%258B%25E5%25BC%258F%25E9%2580%25A3SQL%25E5%2595%258F%25E9%25A1%258C%25E6%258E%2592%25E8%25A7%25A36.jpg&quot; height=&quot;400&quot; width=&quot;367&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
(2) 至SQL Server組態管理員或服務管理查看SQL Browser服務是否有開啟。
&lt;br /&gt;
&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/AVvXsEiEPi7XtIqMKcL1DGnTRZS9EDaC45Qwnp9PVSYE2C63Z12AAHbyhkRncWJrqBurPBUN8G-ZHFplBJE4tO3Ev4LfIAoo1t1MImn-Bi6aAJ3462aygfIYQpo4bjp56Fb0phOq2zFm2F9z-pQ/s1600/%25E7%25A8%258B%25E5%25BC%258F%25E9%2580%25A3SQL%25E5%2595%258F%25E9%25A1%258C%25E6%258E%2592%25E8%25A7%25A37.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEPi7XtIqMKcL1DGnTRZS9EDaC45Qwnp9PVSYE2C63Z12AAHbyhkRncWJrqBurPBUN8G-ZHFplBJE4tO3Ev4LfIAoo1t1MImn-Bi6aAJ3462aygfIYQpo4bjp56Fb0phOq2zFm2F9z-pQ/s400/%25E7%25A8%258B%25E5%25BC%258F%25E9%2580%25A3SQL%25E5%2595%258F%25E9%25A1%258C%25E6%258E%2592%25E8%25A7%25A37.jpg&quot; height=&quot;135&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
(3) 以telnet測試，該port是否可使用。(&lt;a href=&quot;http://wangshifuola.blogspot.tw/2011/02/server2008framework35-telnet.html&quot;&gt;安裝請參考&lt;/a&gt;)
&lt;br /&gt;
&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/AVvXsEhFySuAwC1go1ar4XtELURDh0Vi7UtOyn4_GvdMwTFVFnZ-eE-SSwx7KhgmDV9vCSqgAPgkPX0Xw3Yxiulj6ME_LqOXvmOwFP4BI3xQaKy5rpYwxziEv_N7k_wPi83Sw8vRap1Rj9I5qh4/s1600/%25E7%25A8%258B%25E5%25BC%258F%25E9%2580%25A3SQL%25E5%2595%258F%25E9%25A1%258C%25E6%258E%2592%25E8%25A7%25A38.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFySuAwC1go1ar4XtELURDh0Vi7UtOyn4_GvdMwTFVFnZ-eE-SSwx7KhgmDV9vCSqgAPgkPX0Xw3Yxiulj6ME_LqOXvmOwFP4BI3xQaKy5rpYwxziEv_N7k_wPi83Sw8vRap1Rj9I5qh4/s400/%25E7%25A8%258B%25E5%25BC%258F%25E9%2580%25A3SQL%25E5%2595%258F%25E9%25A1%258C%25E6%258E%2592%25E8%25A7%25A38.jpg&quot; height=&quot;103&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
(4) 確認防火牆是否有開啟，若有開啟確認是否有輸入相關規則。(包含：TCP/1433與UDP/1434)&lt;br /&gt;
&lt;br /&gt;
&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/AVvXsEhVdhM6UR27i6U5EMIU55dHKzAHldrKFHSg-S3WfCjgZQfnqaSqXKGogDntW1sdt8R8Yo5b6kj4goLbG7Wz0fFysVuSJ7poypgc9g47h18zrdjpvcVBu10J9KlobwKSl59xvn_EngTd8ys/s1600/%25E7%25A8%258B%25E5%25BC%258F%25E9%2580%25A3SQL%25E5%2595%258F%25E9%25A1%258C%25E6%258E%2592%25E8%25A7%25A39.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVdhM6UR27i6U5EMIU55dHKzAHldrKFHSg-S3WfCjgZQfnqaSqXKGogDntW1sdt8R8Yo5b6kj4goLbG7Wz0fFysVuSJ7poypgc9g47h18zrdjpvcVBu10J9KlobwKSl59xvn_EngTd8ys/s400/%25E7%25A8%258B%25E5%25BC%258F%25E9%2580%25A3SQL%25E5%2595%258F%25E9%25A1%258C%25E6%258E%2592%25E8%25A7%25A39.jpg&quot; height=&quot;400&quot; width=&quot;323&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&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/AVvXsEjbznif1PrujE_a1oMSX-s0LKMiwHnZEfAX2DSbGuuBPu5TI4VEhDraAx72OCx5ceat3yHXsSoOsyqLhiE_chSlpOj4YwInOdA06JTHyC7Ym9mauX03vLSxUBy5VZzKUTbderhenFgrBMQ/s1600/%25E7%25A8%258B%25E5%25BC%258F%25E9%2580%25A3SQL%25E5%2595%258F%25E9%25A1%258C%25E6%258E%2592%25E8%25A7%25A310.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbznif1PrujE_a1oMSX-s0LKMiwHnZEfAX2DSbGuuBPu5TI4VEhDraAx72OCx5ceat3yHXsSoOsyqLhiE_chSlpOj4YwInOdA06JTHyC7Ym9mauX03vLSxUBy5VZzKUTbderhenFgrBMQ/s400/%25E7%25A8%258B%25E5%25BC%258F%25E9%2580%25A3SQL%25E5%2595%258F%25E9%25A1%258C%25E6%258E%2592%25E8%25A7%25A310.jpg&quot; height=&quot;298&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&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/AVvXsEgtmLUlgrc5FFyZ9scGjRmr3Svj3Nh4nlX4oEGIEOx2jenJ2FvtVK8RyZfikYijen6Ql_MewOV_OUmc3XVvCF97dro9Ca8nlLoqwiTvRay_ewRjXUpc-qBc5ScPUx-HAdunD8bKxPNNd_s/s1600/%25E7%25A8%258B%25E5%25BC%258F%25E9%2580%25A3SQL%25E5%2595%258F%25E9%25A1%258C%25E6%258E%2592%25E8%25A7%25A311.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtmLUlgrc5FFyZ9scGjRmr3Svj3Nh4nlX4oEGIEOx2jenJ2FvtVK8RyZfikYijen6Ql_MewOV_OUmc3XVvCF97dro9Ca8nlLoqwiTvRay_ewRjXUpc-qBc5ScPUx-HAdunD8bKxPNNd_s/s400/%25E7%25A8%258B%25E5%25BC%258F%25E9%2580%25A3SQL%25E5%2595%258F%25E9%25A1%258C%25E6%258E%2592%25E8%25A7%25A311.jpg&quot; height=&quot;296&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
(5) 若是express版本，沒有指定特定port，而使用動態port，則需增加規則。(讓sqlserver.exe可穿越防火牆)&lt;br /&gt;
&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/AVvXsEgDGiDJsY-fobz8Juv0wVQF9imE-711VKlYgyXXrf7UCoPFRveyx1TsvFuE419MASXrXJIxuDW95BdLW4cBP-hyCzYmskmojeSWfHfwTJZxgerYrS2iN9-NqIdMfXBXH7YESQnKQzLZWm4/s1600/%25E7%25A8%258B%25E5%25BC%258F%25E9%2580%25A3SQL%25E5%2595%258F%25E9%25A1%258C%25E6%258E%2592%25E8%25A7%25A312.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDGiDJsY-fobz8Juv0wVQF9imE-711VKlYgyXXrf7UCoPFRveyx1TsvFuE419MASXrXJIxuDW95BdLW4cBP-hyCzYmskmojeSWfHfwTJZxgerYrS2iN9-NqIdMfXBXH7YESQnKQzLZWm4/s400/%25E7%25A8%258B%25E5%25BC%258F%25E9%2580%25A3SQL%25E5%2595%258F%25E9%25A1%258C%25E6%258E%2592%25E8%25A7%25A312.jpg&quot; height=&quot;298&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&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/AVvXsEiRbgwjifJIS89MphDfbJkNvPoU3mouq94qFuliMySggCj6qrNkoKRfewn2VUZG2O3yTk7g8bmcv-oZ1N559r9VOV9DAdfuIGsTDnt35McLLgfZW3UIaFx7KNRBzx9POey63yvaXGNQhJs/s1600/%25E7%25A8%258B%25E5%25BC%258F%25E9%2580%25A3SQL%25E5%2595%258F%25E9%25A1%258C%25E6%258E%2592%25E8%25A7%25A313.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRbgwjifJIS89MphDfbJkNvPoU3mouq94qFuliMySggCj6qrNkoKRfewn2VUZG2O3yTk7g8bmcv-oZ1N559r9VOV9DAdfuIGsTDnt35McLLgfZW3UIaFx7KNRBzx9POey63yvaXGNQhJs/s400/%25E7%25A8%258B%25E5%25BC%258F%25E9%2580%25A3SQL%25E5%2595%258F%25E9%25A1%258C%25E6%258E%2592%25E8%25A7%25A313.jpg&quot; height=&quot;297&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
*.但微軟於官方文件提到：另一種設定具名執行個體到固定通訊埠的方法，就是在防火牆中為像是 sqlservr.exe (針對 Database Engine) 等 SQL Server 程式，建立例外。 雖然這樣做很方便，但是當您使用具有進階安全性 MMC 嵌入式管理單元的 Windows 防火牆時，其通訊埠編號將不會顯示在 [輸入規則] 頁面的 [本機通訊埠] 欄中。 如此一來可能會讓您更難以稽核哪些通訊埠已開啟。其他考量是 Service Pack 或累積更新可能會變更 SQL Server 可執行檔的路徑，因而使防火牆規則失效。&lt;br /&gt;
&lt;br /&gt;
(6) 詢問該單位網路管理員，是否有別的防火牆設備或軟體，請他開啟相關連接埠。&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
以上，若是還是無法正常連接資料庫，那就回家休息一下。</content><link rel='replies' type='application/atom+xml' href='http://wangshifuola.blogspot.com/feeds/3036742743687263791/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://wangshifuola.blogspot.com/2013/01/sqlsql-server.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/3036742743687263791'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/3036742743687263791'/><link rel='alternate' type='text/html' href='http://wangshifuola.blogspot.com/2013/01/sqlsql-server.html' title='SQL_程式無法連線到SQL Server相關問題排解'/><author><name>ola的家</name><uri>http://www.blogger.com/profile/17489699564369049796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUnrwMn6IvUcuEcU6tWY-mlfvU1rZ3NW6EHCAesBaOiHpoDNeJhCgJty3EnJXTHPsjYR53NutZLnli4xiUs1S9da7RXeblHyEORnvbxTUKIYg_x5uU146P69PXmq_fLw/s220/IMG_0442.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNseVLrcqKD1hXSn7s79TIbRISMZq05xfivu5rbWNlsA-kDrHpALygpgi_oDRQRvhW7Cfg6UawXkRzFpL-NYVWPsMAPX0fSgbs6X-cPjNw6Kdu3xkO3I3ZRwT8Wt63hn6TisQDetyEnRQ/s72-c/%25E7%25A8%258B%25E5%25BC%258F%25E9%2580%25A3SQL%25E5%2595%258F%25E9%25A1%258C%25E6%258E%2592%25E8%25A7%25A30.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-379527003650342663.post-9015612913391425980</id><published>2012-12-01T21:33:00.002+08:00</published><updated>2012-12-01T21:36:25.685+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ArcGIS Server"/><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><category scheme="http://www.blogger.com/atom/ns#" term="作品"/><category scheme="http://www.blogger.com/atom/ns#" term="喜歡的事"/><title type='text'>Ola的家 最新力作  2012年冬季鉅獻</title><content type='html'>&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;http://www.youtube.com/embed/aLUK8xXcQGA&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://wangshifuola.blogspot.com/feeds/9015612913391425980/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://wangshifuola.blogspot.com/2012/12/ola-2012-winter.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/9015612913391425980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/9015612913391425980'/><link rel='alternate' type='text/html' href='http://wangshifuola.blogspot.com/2012/12/ola-2012-winter.html' title='Ola的家 最新力作  2012年冬季鉅獻'/><author><name>ola的家</name><uri>http://www.blogger.com/profile/17489699564369049796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUnrwMn6IvUcuEcU6tWY-mlfvU1rZ3NW6EHCAesBaOiHpoDNeJhCgJty3EnJXTHPsjYR53NutZLnli4xiUs1S9da7RXeblHyEORnvbxTUKIYg_x5uU146P69PXmq_fLw/s220/IMG_0442.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/aLUK8xXcQGA/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-379527003650342663.post-815667797500424600</id><published>2012-11-26T21:01:00.003+08:00</published><updated>2012-11-26T21:06:27.696+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><category scheme="http://www.blogger.com/atom/ns#" term="Photoshop"/><category scheme="http://www.blogger.com/atom/ns#" term="作品"/><category scheme="http://www.blogger.com/atom/ns#" term="喜歡的事"/><category scheme="http://www.blogger.com/atom/ns#" term="討厭的事"/><category scheme="http://www.blogger.com/atom/ns#" term="說教與被說教"/><title type='text'>複雜的心情</title><content type='html'>2012年7月27日我存下人生中的第一個PSD檔。&lt;br /&gt;
&lt;br /&gt;
今天，2012年11月26日最新完成的照片標註介面：&lt;br /&gt;
&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/AVvXsEgFZ9l26jBHN4k2osMSmVrDIAe-1eM9-Jbz2C6REUiRwU7c9_Zz7PIS6AmcXZNrhUvIVfcNKxrSleepT6HOVmoYDaRLLyLiwo4Vc0xj4Efvs4ZQAj1e3A-U2s12gFklQZDptdYjmuiSVZw/s1600/image.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFZ9l26jBHN4k2osMSmVrDIAe-1eM9-Jbz2C6REUiRwU7c9_Zz7PIS6AmcXZNrhUvIVfcNKxrSleepT6HOVmoYDaRLLyLiwo4Vc0xj4Efvs4ZQAj1e3A-U2s12gFklQZDptdYjmuiSVZw/s400/image.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
我只想對自己說「喜歡嗎？」 (笑)
</content><link rel='replies' type='application/atom+xml' href='http://wangshifuola.blogspot.com/feeds/815667797500424600/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://wangshifuola.blogspot.com/2012/11/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/815667797500424600'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/815667797500424600'/><link rel='alternate' type='text/html' href='http://wangshifuola.blogspot.com/2012/11/blog-post.html' title='複雜的心情'/><author><name>ola的家</name><uri>http://www.blogger.com/profile/17489699564369049796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUnrwMn6IvUcuEcU6tWY-mlfvU1rZ3NW6EHCAesBaOiHpoDNeJhCgJty3EnJXTHPsjYR53NutZLnli4xiUs1S9da7RXeblHyEORnvbxTUKIYg_x5uU146P69PXmq_fLw/s220/IMG_0442.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFZ9l26jBHN4k2osMSmVrDIAe-1eM9-Jbz2C6REUiRwU7c9_Zz7PIS6AmcXZNrhUvIVfcNKxrSleepT6HOVmoYDaRLLyLiwo4Vc0xj4Efvs4ZQAj1e3A-U2s12gFklQZDptdYjmuiSVZw/s72-c/image.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-379527003650342663.post-8289494008190885100</id><published>2012-11-21T10:22:00.003+08:00</published><updated>2012-11-21T10:22:57.568+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><title type='text'>iOS分享_如何使用Xcode內建工具找到記憶體洩漏(Memory Leak)</title><content type='html'>不管你是自修或是到外面上課，書本或是講師一定會告訴你“管理記憶體”非常的重要，而記憶體管理對於有Ｃ語言底子的人可能非常的自然，但是對於其他程式語言起家的程式設計師（諸如我），倒是一件幾乎完全從零開始的事情;因為知道要管理，我們會在撰寫iOS時自以為地使用alloc分配記憶體，再在自覺得適當的時刻利用release將其釋放掉，當我們完成一個階段並且開始在模擬器或實機跑時，發現程式正常運作，那麼我們可能自我感覺良好的認為完成了一個很ＯＫ的程式。&lt;br /&gt;
&lt;br /&gt;
但是其實有時候可能在某些呼叫的方法上，iOS會自己管理記憶體，並不需要你去觸碰，也有可能在不同function間傳遞時因為操作有誤，導致每次呼叫便使得retaincount不斷上升，而記憶體管理需要不斷地學習，瞭解需要管理與釋放的變數與釋放的時機。&lt;br /&gt;
&lt;br /&gt;
本篇並沒有要提及如何寫出良好記憶體管理的方法，我也沒有能力寫出這樣偉大的文章，但即使我們沒有辦法一次就達到完善的記憶體管理，卻可以經過一些工具一步步向前。&lt;br /&gt;
&lt;br /&gt;
截至目前為止，我所知道要尋找Memory Leak的方法有兩個，你應該針對你的程式先完成第一個測試，再進一步完成第二個，直至程式修改成你所接受的記憶體管理：&lt;br /&gt;
&lt;br /&gt;
1. 使用Xcode的Analyze功能。&lt;br /&gt;
&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/AVvXsEi-vZzkClytaSKZrYZTcxrd8cluwTFiBGzBvP7t8qEWI8ntrpJaChUVqK0tI1-RJ8_8xLhaJSL42LmxHYFUBqaXw_wl-KhqUAYv3U-Sz8_bbP5CNVprghTiUBlM3y4on26WemxGNTHhUVk/s1600/MemoryLeak_1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-vZzkClytaSKZrYZTcxrd8cluwTFiBGzBvP7t8qEWI8ntrpJaChUVqK0tI1-RJ8_8xLhaJSL42LmxHYFUBqaXw_wl-KhqUAYv3U-Sz8_bbP5CNVprghTiUBlM3y4on26WemxGNTHhUVk/s400/MemoryLeak_1.png&quot; width=&quot;205&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
這個功能可以幫助你去尋找程式碼中，有建立記憶體空間卻沒有釋放的位置，我們將一個release註解來看看他的結果：&lt;br /&gt;
&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/AVvXsEiZcroTStGImkMrJn7eQiQhFZY4yaTGMolG5CtS2afjKP3AF9Vkamkpm_V5wQDynAQUjx2LysX2Fng1UODFWq0igkDoKYc3JiSeg5NojniJPGgIs4KYMzA5UsmXmtPrw1yP_qPPJTffNPc/s1600/MemoryLeak_2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;55&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZcroTStGImkMrJn7eQiQhFZY4yaTGMolG5CtS2afjKP3AF9Vkamkpm_V5wQDynAQUjx2LysX2Fng1UODFWq0igkDoKYc3JiSeg5NojniJPGgIs4KYMzA5UsmXmtPrw1yP_qPPJTffNPc/s400/MemoryLeak_2.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
接著你可以對他點擊，以獲取更多的資訊。&lt;br /&gt;
&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/AVvXsEicnO3POVm8GRfCI4wqOBBz8DvEJ8e-nQCiKwbvJvbXEfoNhk52p23uxjbkRSJr8EDQ4AoG7VOnSS4-xku_eKaqhrGLgNa9bPJHkachJqVaxaR_9PfiaGQqMDJtDE6N0KgGynmI2VLYMZI/s1600/MemoryLeak_3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;83&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicnO3POVm8GRfCI4wqOBBz8DvEJ8e-nQCiKwbvJvbXEfoNhk52p23uxjbkRSJr8EDQ4AoG7VOnSS4-xku_eKaqhrGLgNa9bPJHkachJqVaxaR_9PfiaGQqMDJtDE6N0KgGynmI2VLYMZI/s400/MemoryLeak_3.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
這一個測試僅能以編譯的手段，去尋找那些你可能忘記釋放的地方，也就是你必須要釋放的那些變數，所以最基本的要求就是讓該測試沒有任何提醒。但即便該測試完成，也不代表該程式在執行階段不會發生Memory Leak的問題，原因是有可能程式需要上傳相片，那麼我們會使用[NSData dataWithContentsOfFile:filePath];的方式將檔案轉為NSData，再傳送出去，而在從檔案轉成NSData到上傳的過程中，會使用非常多變數與方法，其中一個該釋放但未釋放，則可能造成暫存該檔案的空間一直存在，所以當你不斷進行上傳的動作，會發現你的程式似乎越來越慢？直到Crash為止。&lt;br /&gt;
&lt;br /&gt;
所以我們必須藉由第二個工具來輔助我們尋找程式運行中可能的記憶體洩漏。&lt;br /&gt;
&lt;br /&gt;
2. 使用Xcode的Profile工具。&lt;br /&gt;
&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/AVvXsEinyi0fjG1hph6JwvXtAXD0y_wTH8O4Qw8u3s92T96mc-MqgJfIwUGTpjJl-OvS9_T3YFQhpciBqf5rbGrzzSgx3LHtDuVW5IoTcCqEbxHYUAFkciwK-Kf-z3pQYKJjWfN0Ijz_OcojzfE/s1600/MemoryLeak_4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinyi0fjG1hph6JwvXtAXD0y_wTH8O4Qw8u3s92T96mc-MqgJfIwUGTpjJl-OvS9_T3YFQhpciBqf5rbGrzzSgx3LHtDuVW5IoTcCqEbxHYUAFkciwK-Kf-z3pQYKJjWfN0Ijz_OcojzfE/s400/MemoryLeak_4.png&quot; width=&quot;206&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
點擊後會新開一個名叫Instruments的程式，選Leaks後點擊Profile。
&lt;br /&gt;
&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/AVvXsEhjodL73lZH7qEQcMPXX4mWwJG2w2iqX74SZw2Yg19lGEqs_pdRzicEns2YVsU5aB_mUCZJsg0zBoBZZJxTnWPFft8KYSBYtF8s96z4C_O6BB3rcoL7OGkDXw6vjmuO_UGMv0IUJhe-Pk0/s1600/MemoryLeak_5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;330&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjodL73lZH7qEQcMPXX4mWwJG2w2iqX74SZw2Yg19lGEqs_pdRzicEns2YVsU5aB_mUCZJsg0zBoBZZJxTnWPFft8KYSBYtF8s96z4C_O6BB3rcoL7OGkDXw6vjmuO_UGMv0IUJhe-Pk0/s400/MemoryLeak_5.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
你的程式會開始運作，並且跑出一些好像在監測什麼的圖表？&lt;br /&gt;
&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/AVvXsEiVdRY8RbElCM1Q02t7bUMHw-fMqANhrwsMrEK0VXi3NQWev76y58VLGCrjZp0U5ZzBvymns7izIvZ6MXj0MCyIvSkVj0yfQ8nDWUdrmUEd8IkU4LDhlVnZl8l0NkQ4xVS7yXKj376uOVk/s1600/MemoryLeak_6.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;282&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVdRY8RbElCM1Q02t7bUMHw-fMqANhrwsMrEK0VXi3NQWev76y58VLGCrjZp0U5ZzBvymns7izIvZ6MXj0MCyIvSkVj0yfQ8nDWUdrmUEd8IkU4LDhlVnZl8l0NkQ4xVS7yXKj376uOVk/s400/MemoryLeak_6.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
接著你可以試著操作程式，會發現該圖表不斷的跳動，&lt;br/&gt;
&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/AVvXsEgTixjVjgosNhn5LIikiuuQ7jcDavYfpGwMr7jGR6g99egeu9Ve2xvpJZJQpnRh7zh3vBz_lr1TqH9X9ddP9SEafACM_MSTjFlWy7NzIA4rR11AGOb6QQf6AvggVhFEbdSimdjzW_dB5E4/s1600/MemoryLeak_7.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;282&quot; width=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTixjVjgosNhn5LIikiuuQ7jcDavYfpGwMr7jGR6g99egeu9Ve2xvpJZJQpnRh7zh3vBz_lr1TqH9X9ddP9SEafACM_MSTjFlWy7NzIA4rR11AGOb6QQf6AvggVhFEbdSimdjzW_dB5E4/s400/MemoryLeak_7.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
而這個名為Allocations就是程式記憶體的分配，你可以藉由觀察下方表格的All Allocations*來得知目前的總使用量，若是你不斷地在頁面間來回反覆操作一樣的動作，而該記憶體用量只增不減，就代表在這個動作的過程中，應該有一些需要調整的地方。&lt;br/&gt;
&lt;br/&gt;
當然，我們不能僅藉由這樣的方式來找尋應該要修改的地方，點選左邊的Leaks區域，會進到Leaks的監測畫面：
&lt;br/&gt;
&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/AVvXsEhl_fXwA2lMTRRIXpUyCbFBCi8CBORAwaKcyZbfF6eDutOi_OgywfBE-GsIXzzS4SGNkoPpnF9kwYw7Rs5DrOo0LwXG_sUSZCDNo3ZHs44BJaBXX70jHkcg73LLtMFH2k8zYxvsbTPYP-o/s1600/MemoryLeak_8.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;282&quot; width=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhl_fXwA2lMTRRIXpUyCbFBCi8CBORAwaKcyZbfF6eDutOi_OgywfBE-GsIXzzS4SGNkoPpnF9kwYw7Rs5DrOo0LwXG_sUSZCDNo3ZHs44BJaBXX70jHkcg73LLtMFH2k8zYxvsbTPYP-o/s400/MemoryLeak_8.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
接著在繪圖區與表格區中間，有一個“田”Leaks，點選後選擇Call Tree：&lt;br/&gt;
&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/AVvXsEjNjW1DbrRe407M9CKB6OUScL7VA7Tt1uSGWht48e3Dr61EPwiYIS3mhCTHGUu3dB9lKzG-B2_GsMdxmhjhsIM153uSdT8doyFQKERhGfDm81Z-5tjH6z3jEWmHcCLO3ldrL8IPNUrNsE8/s1600/MemoryLeak_9.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;282&quot; width=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNjW1DbrRe407M9CKB6OUScL7VA7Tt1uSGWht48e3Dr61EPwiYIS3mhCTHGUu3dB9lKzG-B2_GsMdxmhjhsIM153uSdT8doyFQKERhGfDm81Z-5tjH6z3jEWmHcCLO3ldrL8IPNUrNsE8/s400/MemoryLeak_9.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
最後將左側的Hide System Libraries與Invert Call Tree打勾(Hide System Libraries幫助你只檢視自己程式的問題，Invert Call Tree是將檢視的過程顛倒，讓你馬上可以點到出問題的最後一段程式碼)，讓我們製造一些Leak的問題，可以看到該工具會將Leak列表：&lt;br/&gt;
&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/AVvXsEiCooZMRHxRDhyphenhyphen8JUxCm6YfuHDUnAKIlTSzTkU7EvNXdP_CuUeSpiYcxMalmz7ziEPn0GatdENIBVcVXJ6AyqJWsmDQ9swhn_ohJ1P_eDKc8GuArCv5W8264nSiPl0tTC9ac6J8n0iv-sI/s1600/MemoryLeak_10.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;282&quot; width=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCooZMRHxRDhyphenhyphen8JUxCm6YfuHDUnAKIlTSzTkU7EvNXdP_CuUeSpiYcxMalmz7ziEPn0GatdENIBVcVXJ6AyqJWsmDQ9swhn_ohJ1P_eDKc8GuArCv5W8264nSiPl0tTC9ac6J8n0iv-sI/s400/MemoryLeak_10.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
雙擊列表兩下則可以得知“可能”出錯的位置：&lt;br/&gt;
&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/AVvXsEiHAJZzRrPUKYFXbGf5uPpjdCSJ6hUkaqNSKPAH8vFqwp5r6AK4BUlk5SGnliUjg0rLP4a94RO7sBBiAkSEglomRvMR_C2FUTiVnD7gg-O2eHtdiqAXVRPDU4c0jribSf-Oq6b0IvPzQ4k/s1600/MemoryLeak_11.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;282&quot; width=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHAJZzRrPUKYFXbGf5uPpjdCSJ6hUkaqNSKPAH8vFqwp5r6AK4BUlk5SGnliUjg0rLP4a94RO7sBBiAkSEglomRvMR_C2FUTiVnD7gg-O2eHtdiqAXVRPDU4c0jribSf-Oq6b0IvPzQ4k/s400/MemoryLeak_11.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
最後，你可以嘗試的修復這些洩漏，直到程式運作過程完全沒有為止。&lt;br/&gt;
&lt;br/&gt;
講起來有工具而且已經幫助你找到相關位置，理論上應該很容易解決這些問題？但實際上這些Memory Leak的問題通常會牽扯到不同函式間的呼叫，洩漏的位置往往不是問題的原因。連續一個星期都在處理Leak相關問題，這實在比平常在解決其他程式語言的問題時更加令人惱羞，更深深感覺每一個問題的解決背後真的需要很多知識的累積，近一兩年常有人問我要學什麼語言？學什麼最好？某語言好學嗎？我的答案總是讓人不以為然：&lt;br/&gt;
&lt;br/&gt;
你有心學就可以學起來，實際打開電腦寫遠比一直想著要不要學有用多了，而每一種語言的特性都有可能讓你更瞭解別種語言，如果你要學的是if跟for，那什麼都可以學，我第一個學的是MATLAB。</content><link rel='replies' type='application/atom+xml' href='http://wangshifuola.blogspot.com/feeds/8289494008190885100/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://wangshifuola.blogspot.com/2012/11/iosxcodememory-leak.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/8289494008190885100'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/8289494008190885100'/><link rel='alternate' type='text/html' href='http://wangshifuola.blogspot.com/2012/11/iosxcodememory-leak.html' title='iOS分享_如何使用Xcode內建工具找到記憶體洩漏(Memory Leak)'/><author><name>ola的家</name><uri>http://www.blogger.com/profile/17489699564369049796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUnrwMn6IvUcuEcU6tWY-mlfvU1rZ3NW6EHCAesBaOiHpoDNeJhCgJty3EnJXTHPsjYR53NutZLnli4xiUs1S9da7RXeblHyEORnvbxTUKIYg_x5uU146P69PXmq_fLw/s220/IMG_0442.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-vZzkClytaSKZrYZTcxrd8cluwTFiBGzBvP7t8qEWI8ntrpJaChUVqK0tI1-RJ8_8xLhaJSL42LmxHYFUBqaXw_wl-KhqUAYv3U-Sz8_bbP5CNVprghTiUBlM3y4on26WemxGNTHhUVk/s72-c/MemoryLeak_1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-379527003650342663.post-1972436111370270355</id><published>2012-11-13T14:30:00.001+08:00</published><updated>2012-11-13T14:30:33.372+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><title type='text'>iOS學習_如何較易找到exc_bad_access錯誤的源頭</title><content type='html'>&quot;exc_bad_access&quot;是一個令人惱羞的錯誤訊息，出現的原因是“使用了已經釋放記憶體的變數”，如果你很希望好操作程式的記憶體，那就很可能在觀念不清楚的狀態下一直遇到這一個錯誤。&lt;br/&gt;
&lt;br/&gt;
而之所以說很令人惱羞，log並不會顯示任何資訊來供我們判斷，這時可在環境變數中增加一個參數(NSZombieEnabled)，來增加判斷的資訊。&lt;br/&gt;
&lt;br/&gt;
步驟：&lt;br/&gt;
1. 於選單Product選擇Edit Scheme。&lt;br/&gt;
&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/AVvXsEgK4NiKUk1dycJhInGiIky_Hbhm1GEKPmKTzmcvKz9AcOYDrgHT1KHqV7wzoc0Y2O9qaBq9csdqQZnVklY8ho5qstxh-4yzyKBkwfZfbjxncwCB68ZbxOtmEI21bxZyWXS35-PhROnFnEA/s1600/exc_error%25E6%2589%25BE%25E9%258C%25AF%25E8%25AA%25A4%25E4%25BD%258D%25E7%25BD%25AE_1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; width=&quot;208&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK4NiKUk1dycJhInGiIky_Hbhm1GEKPmKTzmcvKz9AcOYDrgHT1KHqV7wzoc0Y2O9qaBq9csdqQZnVklY8ho5qstxh-4yzyKBkwfZfbjxncwCB68ZbxOtmEI21bxZyWXS35-PhROnFnEA/s400/exc_error%25E6%2589%25BE%25E9%258C%25AF%25E8%25AA%25A4%25E4%25BD%258D%25E7%25BD%25AE_1.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
2. 於Arguments的Environment Variables增加參數NSZombieEnabled，並設定為YES。&lt;br/&gt;
&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/AVvXsEhtPq942hxd86GgqLNtG3cH4oOJ6DLOaDn7mL1mqhis4IGp7mZAc9IXXC0cfU0SkdWlif3NWhwtyd3Mb8G0LijsN5BkpzgoXPXwFsoVbdVu9R_yg3K6A2Hajw7SVjFVie_JxRxeh5eGhAU/s1600/exc_error%25E6%2589%25BE%25E9%258C%25AF%25E8%25AA%25A4%25E4%25BD%258D%25E7%25BD%25AE_2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;272&quot; width=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtPq942hxd86GgqLNtG3cH4oOJ6DLOaDn7mL1mqhis4IGp7mZAc9IXXC0cfU0SkdWlif3NWhwtyd3Mb8G0LijsN5BkpzgoXPXwFsoVbdVu9R_yg3K6A2Hajw7SVjFVie_JxRxeh5eGhAU/s400/exc_error%25E6%2589%25BE%25E9%258C%25AF%25E8%25AA%25A4%25E4%25BD%258D%25E7%25BD%25AE_2.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br/&gt;
這時就可以看到錯誤時會多出一句相關錯誤的log。(EX:[__NSArrayM count]: message sent to deallocated instance 0x9bb5620)&lt;br/&gt;
然後再配合Xcode左側的Thread列表，來查找可能的位置與原因。&lt;br/&gt;
&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/AVvXsEjYTnLWhAb1naxr4DyEsm70wXQG08rmMfaIQuy6PEzlKyV4bat5AJ1BsJGle-WlyCANxOLbiVJIe1Iht9RSwdGSAzIIvs47nLAN6KCHlUBvUBza8A3v7ZaHdH6WrjoT5JMdwfFvT-bgkGM/s1600/exc_error%25E6%2589%25BE%25E9%258C%25AF%25E8%25AA%25A4%25E4%25BD%258D%25E7%25BD%25AE_3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; width=&quot;249&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYTnLWhAb1naxr4DyEsm70wXQG08rmMfaIQuy6PEzlKyV4bat5AJ1BsJGle-WlyCANxOLbiVJIe1Iht9RSwdGSAzIIvs47nLAN6KCHlUBvUBza8A3v7ZaHdH6WrjoT5JMdwfFvT-bgkGM/s400/exc_error%25E6%2589%25BE%25E9%258C%25AF%25E8%25AA%25A4%25E4%25BD%258D%25E7%25BD%25AE_3.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;



方法</content><link rel='replies' type='application/atom+xml' href='http://wangshifuola.blogspot.com/feeds/1972436111370270355/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://wangshifuola.blogspot.com/2012/11/iosexcbadaccess.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/1972436111370270355'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/1972436111370270355'/><link rel='alternate' type='text/html' href='http://wangshifuola.blogspot.com/2012/11/iosexcbadaccess.html' title='iOS學習_如何較易找到exc_bad_access錯誤的源頭'/><author><name>ola的家</name><uri>http://www.blogger.com/profile/17489699564369049796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUnrwMn6IvUcuEcU6tWY-mlfvU1rZ3NW6EHCAesBaOiHpoDNeJhCgJty3EnJXTHPsjYR53NutZLnli4xiUs1S9da7RXeblHyEORnvbxTUKIYg_x5uU146P69PXmq_fLw/s220/IMG_0442.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK4NiKUk1dycJhInGiIky_Hbhm1GEKPmKTzmcvKz9AcOYDrgHT1KHqV7wzoc0Y2O9qaBq9csdqQZnVklY8ho5qstxh-4yzyKBkwfZfbjxncwCB68ZbxOtmEI21bxZyWXS35-PhROnFnEA/s72-c/exc_error%25E6%2589%25BE%25E9%258C%25AF%25E8%25AA%25A4%25E4%25BD%258D%25E7%25BD%25AE_1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-379527003650342663.post-3885475096132032259</id><published>2012-11-13T13:45:00.001+08:00</published><updated>2012-11-13T13:46:38.176+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><title type='text'>iOS學習_返回NSMutableArray的函式要正確release的方法(ola的猜測)</title><content type='html'>本文章為筆者自行觀念的瞭解，無法保證一定正確。
-------------------------------------------
NSMutableArray是一個非常好用的型態，我們可以將他看作一個物件陣列(&lt;a href=&quot;http://wangshifuola.blogspot.tw/2012/05/iosnsmutablearraynsmutabledictionary.html&quot;&gt;操作方法&lt;/a&gt;)，慢慢的我們會將處理NSMutableArray獨立出一個一個方法，類似下面的程式碼：&lt;br/&gt;
&lt;code&gt;
-(NSMutableArray *)selectReportingMain_All
&lt;/code&gt;
&lt;br/&gt;
而函式的內容不外乎alloc一個NSMutableArray，然後將適當的物件放進去，在return NSMutableArray：
&lt;br/&gt;
&lt;code&gt;
-(NSMutableArray *)selectReportingMain_All
{   
    NSMutableArray *items = [[NSMutableArray alloc] init];
    if ([db open])
    {
        FMResultSet *rs = [db executeQuery:@&quot;SELECT * From reportingMain&quot;];
        
        while ([rs next]) {
            NSString *reportingID = [rs stringForColumn:@&quot;reportingID&quot;];
            NSString *title = [rs stringForColumn:@&quot;title&quot;];
            NSString *note = [rs stringForColumn:@&quot;note&quot;];
            NSString *xValue = [rs stringForColumn:@&quot;xValue&quot;];
            NSString *yValue = [rs stringForColumn:@&quot;yValue&quot;];
            NSString *time = [rs stringForColumn:@&quot;time&quot;];
            NSString *status = [rs stringForColumn:@&quot;status&quot;];
            
            [items addObject:[NSDictionary dictionaryWithObjectsAndKeys:
                              reportingID , @&quot;reportingID&quot;,
                              title , @&quot;title&quot;,
                              note , @&quot;note&quot;,
                              xValue , @&quot;xValue&quot;,
                              yValue , @&quot;yValue&quot;,
                              time , @&quot;time&quot;,
                              status , @&quot;status&quot;,
                              nil]];
        }

    }
    
    [db close];
    return items;
}
&lt;/code&gt;
&lt;br/&gt;
上述程式碼為SQLite查詢的操作，這樣就可以簡單的將資料庫操作與界面做一個簡單的切割，但是觀察上面的程式碼可能會覺得有點詭異？&lt;br/&gt;
我們並沒有釋放items，難道每一次地使用就會不斷佔用記憶體嗎？這豈不是慢性自殺？&lt;br/&gt;
&lt;br/&gt;
所以必須在適當的時機點進行釋放，所謂適當的時機就是“立刻”。
&lt;code&gt;
return [items autorelease];
&lt;/code&gt;
&lt;br/&gt;
如此，我們即可確保該NSMutableArray有被進行釋放。但通常會去接這一個NSMutableArray的介面都會準備一個全域變數，來承接吐出來的結果。&lt;br/&gt;
&lt;code&gt;
dbOperating *dbO = [[dbOperating alloc] init];
itembag = [dbO selectReportingMain_All];
NSLog(@&quot;items retain:%d&quot;,items.retainCount);
[dbO release];
&lt;/code&gt;
上述程式碼itembag可以很順利地取得結果，但是當該介面的其他函示需要進行操作時，則會產生“exc_bad_access”的錯誤，也就是說你使用了已經釋放的變數。&lt;br/&gt;
&lt;br/&gt;
解決方法：
&lt;code&gt;
dbOperating *dbO = [[dbOperating alloc] init];
itembag = [dbO selectReportingMain_All];
[itembag retain];
NSLog(@&quot;items retain:%d&quot;,items.retainCount);
[dbO release];
&lt;/code&gt;
手動增加itembag的retainCount，這時如果將retainCount輸出，會看到在上述程式碼內retainCount為2，但因回傳的變數是使用[items autorelease]，所以隨即retainCount會降為1，並且也可以正常的讀取使用itembag裡面的值。
</content><link rel='replies' type='application/atom+xml' href='http://wangshifuola.blogspot.com/feeds/3885475096132032259/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://wangshifuola.blogspot.com/2012/11/iosnsmutablearrayrelease.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/3885475096132032259'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/379527003650342663/posts/default/3885475096132032259'/><link rel='alternate' type='text/html' href='http://wangshifuola.blogspot.com/2012/11/iosnsmutablearrayrelease.html' title='iOS學習_返回NSMutableArray的函式要正確release的方法(ola的猜測)'/><author><name>ola的家</name><uri>http://www.blogger.com/profile/17489699564369049796</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUnrwMn6IvUcuEcU6tWY-mlfvU1rZ3NW6EHCAesBaOiHpoDNeJhCgJty3EnJXTHPsjYR53NutZLnli4xiUs1S9da7RXeblHyEORnvbxTUKIYg_x5uU146P69PXmq_fLw/s220/IMG_0442.jpg'/></author><thr:total>0</thr:total></entry></feed>