<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2enclosuresfull.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0">

<channel>
	<title>Life["Breathing"]</title>
	
	<link>http://blog.hsin.tw</link>
	<description />
	<lastBuildDate>Mon, 21 May 2012 12:10:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/hsin" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="hsin" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>[iAPP] paperNote 隨意記事</title>
		<link>http://blog.hsin.tw/2012/papernote/</link>
		<comments>http://blog.hsin.tw/2012/papernote/#comments</comments>
		<pubDate>Mon, 21 May 2012 12:00:07 +0000</pubDate>
		<dc:creator>hsin</dc:creator>
				<category><![CDATA[沒什麼好說的]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://blog.hsin.tw/?p=608</guid>
		<description><![CDATA[http://itunes.apple.com/tw/app/papernote/id518916699?mt=8 軟體分類：Productivity 適用韌體：iOS 5.0 以上 購買費用：免費 1分鐘Demo影片 在畫面上任何地方點兩下即可開始記事 沒有條列式的標題列表 所有記事全部攤開 一目了然 如果是比較重要的記事 可以加上標籤 加上標籤後 畫面邊緣會有箭頭指示該筆記事的位置 點擊箭頭圖示 就會自動滑過去 這個app很迷你 所以不能改顏色 不能畫圖 不能用Email寄出去 單純就是記事而已 推薦給有需要的人 小弟的首發app 有任何問題歡迎留言回應~]]></description>
			<content:encoded><![CDATA[<p><a href="http://itunes.apple.com/tw/app/papernote/id518916699?mt=8">http://itunes.apple.com/tw/app/papernote/id518916699?mt=8</a><br />
<span id="more-608"></span><br />
軟體分類：Productivity<br />
適用韌體：iOS 5.0 以上<br />
購買費用：免費</p>
<p>1分鐘Demo影片<br />

<!-- Iframe plugin v.2.2 (wordpress.org/extend/plugins/iframe/) -->
<iframe src="http://www.youtube.com/embed/ewmykeC7xpw" width="560" height="315" scrolling="no" class="iframe-class" frameborder="0"></iframe></p>
<p>在畫面上任何地方點兩下即可開始記事</p>
<p>沒有條列式的標題列表</p>
<p>所有記事全部攤開 一目了然</p>
<p>如果是比較重要的記事 可以加上標籤</p>
<p>加上標籤後 畫面邊緣會有箭頭指示該筆記事的位置</p>
<p>點擊箭頭圖示 就會自動滑過去</p>
<p>這個app很迷你 所以不能改顏色 不能畫圖 不能用Email寄出去</p>
<p>單純就是記事而已 推薦給有需要的人</p>
<p>小弟的首發app 有任何問題歡迎留言回應~</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hsin.tw/2012/papernote/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[iOS Dev] Core Data 筆記1</title>
		<link>http://blog.hsin.tw/2012/ios-dev-core-data-note1/</link>
		<comments>http://blog.hsin.tw/2012/ios-dev-core-data-note1/#comments</comments>
		<pubDate>Tue, 15 May 2012 10:46:38 +0000</pubDate>
		<dc:creator>hsin</dc:creator>
				<category><![CDATA[iOS Dev]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://blog.hsin.tw/?p=588</guid>
		<description><![CDATA[主要是看CS193P課程 (2011 Fall) 的內容 小弟我的英聽跟閱讀實在很弱 如果我有寫錯的地方請不吝地跟我講 謝謝~ (揮手) 所以如果想看完整內容請看iTunes上的CS193P課程 13. Core Data (November 8,2011) 14. Core Data Demo (November 10,2011) 首先是建立virtual mapping (就像是建立table一樣) 左邊選單的專案先focus後 按右鍵選擇New File&#8230; 依序選擇 iOS下的Core Data -&#62; Data Model 接著就是儲存位置跟名稱 如果只有一個的話 就取跟專案名稱一樣後面加上Model就好 (其實都可以啦XD 認得是Model就好) 建立好後 左邊檔案列表中就會出現一個 .xcdatamodeld &#8230; <a href="http://blog.hsin.tw/2012/ios-dev-core-data-note1/">繼續閱讀 <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>主要是看CS193P課程 (2011 Fall) 的內容<br />
<span id="more-588"></span><br />
小弟我的英聽跟閱讀實在很弱<br />
如果我有寫錯的地方請不吝地跟我講 謝謝~ (揮手)<br />
所以如果想看完整內容請看iTunes上的CS193P課程<br />
13. Core Data (November 8,2011)<br />
14. Core Data Demo (November 10,2011)</p>
<p>首先是建立virtual mapping (就像是建立table一樣)<br />
左邊選單的專案先focus後<br />
按右鍵選擇<strong>New File&#8230;</strong><br />
依序選擇 <strong>iOS下的Core Data</strong>  -&gt;  <strong>Data Model</strong><br />
接著就是儲存位置跟名稱<br />
如果只有一個的話 就取跟專案名稱一樣後面加上Model就好<br />
(其實都可以啦XD 認得是Model就好)<br />
建立好後 左邊檔案列表中就會出現一個 .xcdatamodeld 的檔案<br />
(取名字是 coreDataTestModel 就會是 coreDataTestModel.xcdatamodeld )</p>
<p>點這個 .xcdatamodeld 檔案後 主畫面會出現兩欄(左窄右寬)<br />
[左欄]<br />
ENTITIES<br />
FETCH REQUESTS<br />
CONFIGURATIONS<br />
[右欄]<br />
Attributes<br />
Relationships<br />
Fetched Properties</p>
<p>這邊就是跟MySQL資料庫差不多 以下是相對的名稱<br />
[資料庫]          &#8212;&#8211;&gt;         [Core Data]<br />
資料表(table)   &#8212;&#8211;&gt;      Entity<br />
欄位(field)      &#8212;&#8211;&gt;       Attribute<br />
table間關聯    &#8212;&#8211;&gt;       Relationship (有點像join)</p>
<p>新增entity跟attribute的方式很直覺<br />
下面都有加號可以add<br />
entity取名字的第一個字母必須大寫<br />
attribute除了取名字外 還要選擇type 就是欄位型態 下拉選單一拉就很清楚了</p>
<p>右下角有個 <strong>Editor Style</strong> 可以切換成圖形化<br />
在圖形化下 一樣可以做上面的新增修改(這邊還滿直覺的 有卡住的請再發問)</p>
<p>如果建立兩個entity以上的話 各entity間可以作relationship<br />
圖形化下 對一個entity按 <strong>ctrl + 左鍵</strong> 再拖拉到另一個entity<br />
就可以完成一個relationship<br />
剛建立好會命名為newRelationship 可以點他改名字<br />
各自entity可以從這個relationship來取得另一個entity的資訊<br />
(有點抽象 看看下面例子)</p>
<p>Ex:<br />
entity1: Photo<br />
entity2: Photographer<br />
Photo的newRelationship重新命名為whotook<br />
Photographer的newRelationship重新命名為photos</p>
<p>點relationship後 右邊選單屬性裡面有一個Plural   To-Many Relationship<br />
如果是一對多 就要打勾<br />
所以 Photo 裡的 whotook 因為一張照片只會有一個攝影者 所以不用打勾<br />
Photographer 的 photos 就要打勾 因為一個攝影者 可能會有很多張照片<br />
也是有可能 一對一、多對多 看你的資料庫怎麼設定的</p>
<p>之後就可以從 Photo 裡的 whotook 來取得 Photographer 的資訊<br />
或是從 Photographer 的 photos 取得 Photo 的資訊</p>
<p>儲存資訊時 會用到 :setValue:forKey 這個method<br />
為了簡化成 可以用  XXX.YYY.ZZZ 的方式設值<br />
在 .xcdatamodeld 裡面 選取所有的entity (用shift選)<br />
按工具列上 Editor 裡面的 Create NSManagedObject Subclass<br />
如果是2個以上的entity並且有作relationship<br />
這個動作要作兩次 (原因請看課程)<br />
作兩次就是了 第二次會replace過去 就replace吧</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hsin.tw/2012/ios-dev-core-data-note1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[iOS Dev] UIScrollView的touchesBegan和touchesEnd</title>
		<link>http://blog.hsin.tw/2012/ios-dev-uiscrollview-touchesbegan-touchesend/</link>
		<comments>http://blog.hsin.tw/2012/ios-dev-uiscrollview-touchesbegan-touchesend/#comments</comments>
		<pubDate>Sun, 22 Apr 2012 10:22:48 +0000</pubDate>
		<dc:creator>hsin</dc:creator>
				<category><![CDATA[iOS Dev]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://blog.hsin.tw/?p=551</guid>
		<description><![CDATA[touchesBegan跟touchedEnd沒有提供給UIScrollViewDelegate 所以要自己建立一個繼承自UIScrollView的class 重寫這兩個method ▼ myScrollView.h ▼ myScrollView.m 之後建立UIScrollView就是用myScrollView建立 即可使用這兩個method]]></description>
			<content:encoded><![CDATA[<p>touchesBegan跟touchedEnd沒有提供給UIScrollViewDelegate<span id="more-551"></span><br />
所以要自己建立一個繼承自UIScrollView的class<br />
重寫這兩個method</p>
<p>▼ myScrollView.h</p>
<pre class="brush: cpp; title: ; notranslate">
@interface myScrollView : UIScrollView
@end
</pre>
<p>▼ myScrollView.m</p>
<pre class="brush: cpp; title: ; notranslate">

-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
    [super touchesBegan:touches withEvent:event];
    if ( !self.dragging )
    {
        [[self nextResponder] touchesBegan:touches withEvent:event];
    }
}

-(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
    [super touchesEnded:touches withEvent:event];
    if ( !self.dragging )
    {
        [[self nextResponder] touchesEnded:touches withEvent:event];
    }
}
</pre>
<p>之後建立UIScrollView就是用myScrollView建立 即可使用這兩個method</p>
<pre class="brush: cpp; title: ; notranslate">
myScrollView *contentScrollView = [[myScrollView alloc] init];
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.hsin.tw/2012/ios-dev-uiscrollview-touchesbegan-touchesend/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[iOS Dev] subclass使用super的value或method</title>
		<link>http://blog.hsin.tw/2012/ios-dev-subclass-use-super-value-or-method/</link>
		<comments>http://blog.hsin.tw/2012/ios-dev-subclass-use-super-value-or-method/#comments</comments>
		<pubDate>Sat, 21 Apr 2012 10:06:39 +0000</pubDate>
		<dc:creator>hsin</dc:creator>
				<category><![CDATA[iOS Dev]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://blog.hsin.tw/?p=553</guid>
		<description><![CDATA[要透過delegate及protocol來完成 這邊測試的 sublcass 叫做 contentView 繼承自 UILabel (都可以 只是這邊用UILabel示範 用啥都無差別) ▼ contentView.h ▼ contentView.m subclass這樣就暫時完成了 接著是ViewController的內容 ▼ myViewController.h ▼ myViewController.m]]></description>
			<content:encoded><![CDATA[<p>要透過delegate及protocol來完成<span id="more-553"></span></p>
<p>這邊測試的 sublcass 叫做 contentView<br />
繼承自 UILabel<br />
(都可以 只是這邊用UILabel示範 用啥都無差別)</p>
<p>▼ contentView.h </p>
<pre class="brush: cpp; title: ; notranslate">
// 建立一個protocol 待會要給super的class用的
@protocol contentDelegate &lt;NSObject&gt;
// required就是一定要寫的 不寫會報錯誤
@required
-(void) updateContent:(int) myid;

@end
#import &lt;UIKit/UIKit.h&gt;

@interface contentView : UILabel
@property (nonatomic) int myid;
// 用來指定delegate的
@property (nonatomic, assign) id&lt;contentDelegate&gt; mydelegate;
@end
</pre>
<p>▼ contentView.m </p>
<pre class="brush: cpp; title: ; notranslate">
#import &quot;contentView.h&quot;

@implementation contentView
// synthesize 記得要寫
@synthesize mydelegate;
@synthesize myid;

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
    }
    return self;
}

// 這邊測試用的是 當點擊次數為1時 會執行mydelegate的method
// mydelegate就是待會要設定為super的class
-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
    UITouch *touch = [touches anyObject];
    if(touch.tapCount == 1){
        [mydelegate updateContent:self.myid];
    }
}

@end
</pre>
<p>subclass這樣就暫時完成了<br />
接著是ViewController的內容</p>
<p>▼ myViewController.h</p>
<pre class="brush: cpp; title: ; notranslate">
#import &lt;UIKit/UIKit.h&gt;
// 記得要import
#import &quot;contentView.h&quot;

// delegate則是加上剛剛在contentView建立的delegate (也就是透過protocol)
@interface myViewController : UIViewController&lt;contentDelegate&gt;
@end
</pre>
<p>▼ myViewController.m</p>
<pre class="brush: cpp; title: ; notranslate">
- (void)viewDidLoad
{
    [super viewDidLoad];

    // 建立一個contentView
    contentView *thisContentView = [[contentView alloc] initWithFrame:CGRectMake(0, 0, 100,50)];
    // 並將delegate設為self
    thisContentView.mydelegate = self;

    [self.view addSubview:thisContentView];
}

// 因為在contentView中有加一個required的method
// 所以這邊一定要實作 不然會報錯誤
-(void) updateContent:(int) myid{
    /*
    依據從 contentView 傳來的 myid 來作一些變動
    當然這都是測試用的 單純只是執行一個method也是可以

    主要就是示範在subclass執行superclass的method
    如果是要獲得super的值 就是return回去即可
    */
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.hsin.tw/2012/ios-dev-subclass-use-super-value-or-method/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[jquery] 不懂javascript的網頁設計師也可以輕鬆上手的jquery</title>
		<link>http://blog.hsin.tw/2012/jquery-easy-steps/</link>
		<comments>http://blog.hsin.tw/2012/jquery-easy-steps/#comments</comments>
		<pubDate>Thu, 19 Apr 2012 17:35:33 +0000</pubDate>
		<dc:creator>hsin</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://blog.hsin.tw/?p=565</guid>
		<description><![CDATA[既然有人問了 那就簡單整理一下 有哪邊不懂的歡迎提出 STEP.1 引入jquery檔案 這邊使用google托管的檔案 就不用另外放一支jquery的檔案在自己的目錄下 如果他去的別的網站也有用 也就不用再load一次 ▼將這行放在head標籤裡面 STEP.2 jquery的碼要擺在&#8230; 除了function以外的碼 (看不懂function的意思 就先不用在意他了) 通通都放在下面這兩個其中一個裡(任選一個 兩個是一樣的) 再把整段script標籤放在body標籤裡 ▼將所有jquery的碼放在這裡面 STEP.3 選擇器怎麼用 你要操作哪一個標籤的東西 就把他放在 $(裡面) 用法就跟css的選擇器 幾乎完全一樣 記得用單引號 &#8216; 或是 雙引號 " 前後包起來 更多請看我之前寫的筆記或是官方文件(英文的) ▼ 幾個範例 STEP.4 對標籤做操作 這邊只有介紹些許功能 更多請看我之前的筆記或是官方文件 ▼ &#8230; <a href="http://blog.hsin.tw/2012/jquery-easy-steps/">繼續閱讀 <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>既然有人問了<span id="more-565"></span><br />
那就簡單整理一下<br />
有哪邊不懂的歡迎提出</p>
<p><span style="font-size:36px;font-family:bold">STEP.1 引入jquery檔案</span><br />
這邊使用google托管的檔案<br />
就不用另外放一支jquery的檔案在自己的目錄下<br />
如果他去的別的網站也有用 也就不用再load一次</p>
<p>▼將這行放在head標籤裡面</p>
<pre class="brush: xml; title: ; notranslate">
&lt;head&gt;
&lt;!-- 一些其他的東西 --&gt;
&lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;!-- 一些其他的東西 --&gt;
&lt;/head&gt;
</pre>
<div style="font-size:36px;font-family:bold;margin-top:100px;margin-bottom:25px">STEP.2 jquery的碼要擺在&#8230;</div>
<p>除了function以外的碼 (看不懂function的意思 就先不用在意他了)<br />
通通都放在下面這兩個其中一個裡(任選一個 兩個是一樣的)<br />
再把整段script標籤放在body標籤裡<br />
▼將所有jquery的碼放在這裡面</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script&gt;
$(document).ready(function(){
    //通通放在這裡面
    //通通放在這裡面
});
// 或是 下面這樣
$(function(){
    //通通放在這裡面
    //通通放在這裡面
});
&lt;/script&gt;
</pre>
<div style="font-size:36px;font-family:bold;margin-top:100px;margin-bottom:25px">STEP.3 選擇器怎麼用</div>
<p>你要操作哪一個標籤的東西<br />
就把他放在 $(裡面)<br />
用法就跟css的選擇器 幾乎完全一樣<br />
記得用單引號 &#8216; 或是 雙引號 " 前後包起來<br />
更多請看<a href="http://blog.hsin.tw/2009/jquery-in-action-ch1-introuducing-jquery/">我之前寫的筆記</a>或是<a href="http://api.jquery.com/category/selectors/">官方文件(英文的)</a><br />
▼ 幾個範例</p>
<pre class="brush: jscript; title: ; notranslate">
// 如果是內建的標籤 (後面的.attr(&quot;name&quot;)下一個STEP會講)
// $(&quot;div&quot;)
$(&quot;div&quot;).attr(&quot;name&quot;);
$(&quot;a&quot;).attr(&quot;name&quot;);

// 如果是id的話
// $(&quot;#myform&quot;)
$(&quot;#myform&quot;).attr(&quot;name&quot;);
$(&quot;#content&quot;).attr(&quot;name&quot;);

//如果是class的話
// $(&quot;.btn&quot;)
$(&quot;.btn&quot;).attr(&quot;name&quot;);
$(&quot;.hint&quot;).attr(&quot;name&quot;);

//當然也可以結合
$(&quot;div.hint&quot;).attr(&quot;name&quot;);
$(&quot;a#content&quot;).attr(&quot;name&quot;);
</pre>
<div style="font-size:36px;font-family:bold;margin-top:100px;margin-bottom:25px">STEP.4 對標籤做操作</div>
<p>這邊只有介紹些許功能<br />
更多請看<a href="http://blog.hsin.tw/2009/jquery-in-action-ch3/">我之前的筆記</a>或是<a href="http://api.jquery.com/category/css/">官方文件</a></p>
<p>▼ html標籤的屬性</p>
<pre class="brush: xml; title: ; notranslate">
&lt;a id=&quot;content&quot; name=&quot;myaaa&quot;&gt;這是個a標籤&lt;/a&gt;
</pre>
<p>▼操作上面這個a標籤</p>
<pre class="brush: jscript; title: ; notranslate">
$(&quot;a#content&quot;).attr(&quot;name&quot;);
//會得到name屬性的值 也就是myaaa

//要修改name呢 則是
$(&quot;a#content&quot;).attr(&quot;name&quot;,&quot;mynewbbb&quot;);
// 這樣就會將name從myaaa改成mynewbbb
</pre>
<p>▼ style(也就是css)</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;content&quot; style=&quot;color:#3c3c3c;background-color:#ffffff;&quot;&gt;這是個div&lt;/div&gt;
</pre>
<p>▼ 操作上面這個div標籤</p>
<pre class="brush: jscript; title: ; notranslate">
$(&quot;#content&quot;).css(&quot;color&quot;);
//會得到color的值 也就是#3c3c3c

//要修改呢 則是
$(&quot;a#content&quot;).css(&quot;backgroundColor&quot;,&quot;#cc00ff&quot;);
// 這樣就會將background-color從#ffffff改成#cc00ff

// 這邊有另一個重點是 如果css有橫線- 則是改成去掉橫線 橫線後面的第一個字母大寫
// background-color 就要寫成 backgroundColor
</pre>
<p>▼增加及減少class</p>
<pre class="brush: jscript; title: ; notranslate">
// 增加hint這個classname
$(&quot;#content&quot;).addClass(&quot;hint&quot;);

// 減少hint這個classname
$(&quot;#content&quot;).removeClass(&quot;hint&quot;);
</pre>
<div style="font-size:36px;font-family:bold;margin-top:100px;margin-bottom:25px">STEP.5 怎麼觸發jquery神奇的功能</div>
<p>這邊介紹常用的click,mouseover,mouseout<br />
更多請看<a href="http://blog.hsin.tw/2009/jquery-in-action-ch4/">我之前寫的筆記</a>或是<a href="http://api.jquery.com/category/events/">官方文件</a><br />
在上一個step知道怎麼操作了之後<br />
當然還需要做一些觸發的動作 來去操作<br />
▼ click</p>
<pre class="brush: jscript; title: ; notranslate">
// 按到id=content的標籤時 將他的背景色改為紅色
$(&quot;#content&quot;).click(function(){
    $(&quot;#content&quot;).css(&quot;backgroundColor&quot;,&quot;red&quot;);
});
</pre>
<p>▼ mouseover,mouseout</p>
<pre class="brush: jscript; title: ; notranslate">
// 游標移到id=content的標籤上時 為他增加一個class
$(&quot;#content&quot;).mouseover(function(){
    $(&quot;#content&quot;).addClass(&quot;hint&quot;);
});
// 游標離開id=content的標籤上時 將一個class移除
$(&quot;#content&quot;).mouseout(function(){
    $(&quot;#content&quot;).removeClass(&quot;hint&quot;);
});
</pre>
<div style="font-size:36px;font-family:bold;margin-top:100px;margin-bottom:25px"></div>
<p>以上五點希望可以給未接觸過jquery的朋友了解一下jquery的用法<br />
當然他可以做的事還非常的多<br />
要深入請再研讀官方文件<br />
或咕狗咕狗<br />
有問題也可以發問<br />
我會的會盡量回答</p>
<p>jquery真的很好用窩~~~</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hsin.tw/2012/jquery-easy-steps/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>[iOS Dev] UITextView輸入時 游標都從內容開頭開始</title>
		<link>http://blog.hsin.tw/2012/ios-dev-uitextview-cursor-move-to-top/</link>
		<comments>http://blog.hsin.tw/2012/ios-dev-uitextview-cursor-move-to-top/#comments</comments>
		<pubDate>Thu, 19 Apr 2012 04:57:21 +0000</pubDate>
		<dc:creator>hsin</dc:creator>
				<category><![CDATA[iOS Dev]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://blog.hsin.tw/?p=549</guid>
		<description><![CDATA[UITextView輸入時 游標都從內容開頭開始 ref : http://tc.itkee.com/designer/detail-19d4.html]]></description>
			<content:encoded><![CDATA[<p>UITextView輸入時<span id="more-549"></span><br />
游標都從內容開頭開始</p>
<pre class="brush: cpp; title: ; notranslate">
    UITextView *contentBox = [[UITextView alloc] init];
    contentBox.text = @&quot;abcdefghijklmnopqrstuvwxyz&quot;;
    [self.view addSubview:contentBox];

    //游標從內容開頭開始
    NSRange range;
    range.location = 0;
    range.length  = 0;
    contentBox.selectedRange = range;
</pre>
<p>ref : <a href="http://tc.itkee.com/designer/detail-19d4.html">http://tc.itkee.com/designer/detail-19d4.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hsin.tw/2012/ios-dev-uitextview-cursor-move-to-top/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[iOS Dev] UIScrollView滑動到指定位置 並在滑動完成後執行動作</title>
		<link>http://blog.hsin.tw/2012/ios-dev-uiscrollview-scroll-to-position-and-do-something-after-scrolling/</link>
		<comments>http://blog.hsin.tw/2012/ios-dev-uiscrollview-scroll-to-position-and-do-something-after-scrolling/#comments</comments>
		<pubDate>Wed, 18 Apr 2012 06:25:41 +0000</pubDate>
		<dc:creator>hsin</dc:creator>
				<category><![CDATA[iOS Dev]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://blog.hsin.tw/?p=546</guid>
		<description><![CDATA[UIScrollView滑動到指定位置 並在滑動完成後執行動作 在滑動完成後執行動作的method在delegate中 所以要先將這個ViewController加上delegate ▼ myViewController.h ▼ myViewController.m 以下兩個則是ViewController加上delegate之後可以設定的method]]></description>
			<content:encoded><![CDATA[<p>UIScrollView滑動到指定位置<span id="more-546"></span><br />
並在滑動完成後執行動作</p>
<p>在滑動完成後執行動作的method在delegate中<br />
所以要先將這個ViewController加上delegate</p>
<p>▼ myViewController.h</p>
<pre class="brush: cpp; title: ; notranslate">
// 加上UIScrollViewDelegate
@interface myViewController : UIViewController&lt;UIScrollViewDelegate&gt;

@end
</pre>
<p>▼ myViewController.m</p>
<pre class="brush: cpp; title: ; notranslate">
- (void)viewDidLoad
{
    [super viewDidLoad];

    UIScrollView *myscrollView=[[UIScrollView alloc] initWithFrame: CGRectMake(0,0,320,460)];
    // 滑動完成後要執行動作 記得delegate要設為self
    myscrollView.delegate = self;

    // 滑動到position的位置
    CGPoint position = CGPointMake(100, 150);
    [myscrollView setContentOffset:position animated:YES];

}
</pre>
<p>以下兩個則是ViewController加上delegate之後可以設定的method</p>
<pre class="brush: cpp; title: ; notranslate">
-(void) scrollViewDidScroll:(UIScrollView *) scrollView{
    // 滑動時觸發
}

-(void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView
{
    // 滑動完成時觸發
    // 經由 setContentOffset:animated: 滑動完成才會喔
    // 如果是手動滑的不會觸發
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.hsin.tw/2012/ios-dev-uiscrollview-scroll-to-position-and-do-something-after-scrolling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[iOS Dev] UILabel依據文字內容的多寡 設定自己的尺寸(長寬)</title>
		<link>http://blog.hsin.tw/2012/ios-dev-uilabel-adaptive-size-from-its-text/</link>
		<comments>http://blog.hsin.tw/2012/ios-dev-uilabel-adaptive-size-from-its-text/#comments</comments>
		<pubDate>Tue, 17 Apr 2012 05:39:49 +0000</pubDate>
		<dc:creator>hsin</dc:creator>
				<category><![CDATA[iOS Dev]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://blog.hsin.tw/?p=538</guid>
		<description><![CDATA[依據UILabel的文字內容多寡 設定UILabel自己的尺寸 [提醒一下] 記得字型跟大小要設為一樣喔 ref : http://www.cnblogs.com/superhappy/archive/2012/01/31.html]]></description>
			<content:encoded><![CDATA[<p>依據UILabel的文字內容多寡<span id="more-538"></span><br />
設定UILabel自己的尺寸</p>
<pre class="brush: cpp; title: ; notranslate">
-(void) viewDidLoad{
    [super viewDidLoad];

    // 位置與大小
    UILabel *myLabel=[[UILabel alloc] initWithFrame:CGRectMake(0, 0, 2, 2)];

    // 文字字型及大小
    [myLabel setFont:[UIFont fontWithName:@&quot;Helvetica&quot; size:20]];

    // 行數 只有設定為0才能自適應尺寸
    [myLabel setNumberOfLines:0];

    // 文字內容
    NSString *mytext = @&quot;abcdefghijklmnopqrstuvwxyz&quot;;

    // 字型及大小 必須跟UILabel的一樣
    UIFont *font = [UIFont fontWithName:@&quot;Helvetica&quot; size:20];

    // 獲得尺寸
    CGSize size = [mytext sizeWithFont:font constrainedToSize:CGSizeMake(150, 2000) lineBreakMode:UILineBreakModeWordWrap];

    // 設定Label的內容跟尺寸
    myLabel.frame.size = size;
    myLabel.text = text;

    [self.view addSubview:myLabel];
}
</pre>
<p>[提醒一下] 記得字型跟大小要設為一樣喔</p>
<p>ref : <a href="http://www.cnblogs.com/superhappy/archive/2012/01/31.html">http://www.cnblogs.com/superhappy/archive/2012/01/31.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hsin.tw/2012/ios-dev-uilabel-adaptive-size-from-its-text/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[iOS Dev] iOS5在輸入不同語言時 鍵盤高度會不一樣</title>
		<link>http://blog.hsin.tw/2012/ios-dev-nsnotificationcenter-keyboardwillshow/</link>
		<comments>http://blog.hsin.tw/2012/ios-dev-nsnotificationcenter-keyboardwillshow/#comments</comments>
		<pubDate>Mon, 16 Apr 2012 07:45:34 +0000</pubDate>
		<dc:creator>hsin</dc:creator>
				<category><![CDATA[iOS Dev]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://blog.hsin.tw/?p=536</guid>
		<description><![CDATA[在iOS5之後 切換到中文輸入時 高度會和打英文時不一樣 剛升到iOS5時 What&#8217;s app有出現一陣子的問題 鍵盤會擋住輸入框 應該就是因為這個 所以必須在鍵盤出現時 監視高度改變以作不同的因應 另外要加method ref : http://www.cocoachina.com/bbs/read.php?tid=98430 http://psvsps2.blogspot.com/2010/04/notification-note-contents-what-is_18.html]]></description>
			<content:encoded><![CDATA[<p>在iOS5之後<span id="more-536"></span><br />
切換到中文輸入時<br />
高度會和打英文時不一樣</p>
<p>剛升到iOS5時<br />
What&#8217;s app有出現一陣子的問題<br />
鍵盤會擋住輸入框<br />
應該就是因為這個</p>
<p>所以必須在鍵盤出現時<br />
監視高度改變以作不同的因應</p>
<pre class="brush: cpp; title: ; notranslate">
    //使用NSNotificationCenter 鍵盤出現時
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(keyboardWillShow:)
                                                 name:UIKeyboardWillShowNotification
                                               object:nil];

    // 鍵盤消失時
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(keyboardWillHidden:)
                                                 name:UIKeyboardWillHideNotification
                                               object:nil];
</pre>
<p>另外要加method</p>
<pre class="brush: cpp; title: ; notranslate">
-(void)keyboardWillShow:(NSNotification *) notification{
    NSDictionary* info = [notification userInfo];
    // kbSize即為鍵盤尺寸 (有width, height)
    CGSize kbSize = [[info objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue].size;//得到鍵盤的高度
    NSLog(@&quot;當前鍵盤高度 WillShown %f&quot;,kbSize.height);
    //再依據不同的高度 作不同的因應
}

//鍵盤消失時則是加這個
- (void)keyboardWillHidden:(NSNotification*)aNotification{
    // something
}
</pre>
<p>ref : <a href="http://www.cocoachina.com/bbs/read.php?tid=98430">http://www.cocoachina.com/bbs/read.php?tid=98430</a><br />
<a href="http://psvsps2.blogspot.com/2010/04/notification-note-contents-what-is_18.html">http://psvsps2.blogspot.com/2010/04/notification-note-contents-what-is_18.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hsin.tw/2012/ios-dev-nsnotificationcenter-keyboardwillshow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[iOS Dev] 獲得螢幕的範圍大小</title>
		<link>http://blog.hsin.tw/2012/ios-dev-screen-size/</link>
		<comments>http://blog.hsin.tw/2012/ios-dev-screen-size/#comments</comments>
		<pubDate>Sun, 15 Apr 2012 09:00:26 +0000</pubDate>
		<dc:creator>hsin</dc:creator>
				<category><![CDATA[iOS Dev]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://blog.hsin.tw/?p=531</guid>
		<description><![CDATA[分為包不包含最上面狀態列的尺寸 因為狀態列可以設定要不要顯示 所以會需要這兩種尺寸 視使用情況選擇不同的尺寸 返回的都是CGRect 所以會包含origin (有x,y) 跟 size (有width,height)]]></description>
			<content:encoded><![CDATA[<p>分為包不包含最上面狀態列的尺寸<span id="more-531"></span></p>
<pre class="brush: cpp; title: ; notranslate">
    //包含狀態列
    CGRect fullScreenBounds = [[UIScreen mainScreen] bounds];

    //不包含狀態列
    CGRect fullScreenRect = [[UIScreen mainScreen] applicationFrame];
</pre>
<p>因為狀態列可以設定要不要顯示<br />
所以會需要這兩種尺寸<br />
視使用情況選擇不同的尺寸</p>
<p>返回的都是CGRect<br />
所以會包含origin (有x,y) 跟 size (有width,height)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hsin.tw/2012/ios-dev-screen-size/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

