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

<channel>
	<title>“我”的开发笔记 &#187; iPhone开发</title>
	<atom:link href="http://c.gzl.name/archives/category/iphone/feed" rel="self" type="application/rss+xml" />
	<link>http://c.gzl.name</link>
	<description>IPhone, Cocoa, PHP, Javascript, JQuery, Actionscript, etc...</description>
	<lastBuildDate>Thu, 29 Dec 2011 07:20:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>iPhone:针对不同设备,使用不同CSS</title>
		<link>http://c.gzl.name/archives/581</link>
		<comments>http://c.gzl.name/archives/581#comments</comments>
		<pubDate>Sat, 03 Jul 2010 23:02:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Webkit]]></category>
		<category><![CDATA[iPhone开发]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://c.gzl.name/?p=581</guid>
		<description><![CDATA[上个文章聊了一下怎么检测iPhone/iPod/iPad, 接下来我们就需要实施CSS了 if&#40;&#40;navigator.userAgent.match&#40;/iPhone/i&#41;&#41; &#124;&#124; &#40;navigator.userAgent.match&#40;/iPod/i&#41;&#41;&#41;&#123; document.write&#40;'&#60;link href=&#34;iphone.css&#34; rel=&#34;stylesheet&#34; type=&#34;text/css&#34;&#62;'&#41;; &#125; if&#40;&#40;navigator.userAgent.match&#40;/iPad/i&#41;&#41;&#41;&#123; document.write&#40;'&#60;link href=&#34;ipadwoflash.css&#34; rel=&#34;stylesheet&#34; type=&#34;text/css&#34;&#62;'&#41;; &#125; 以上的javascript在检测到是iphone和ipod touch的时候就会写入iphone的css, 在检测到ipad的时候就会使用一个为ipad准备的没有flash的css结构~ 南无阿弥陀佛 南无本师释迦牟尼佛 南无药师琉璃光如来]]></description>
		<wfw:commentRss>http://c.gzl.name/archives/581/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone:Javascript/PHP检测iPhone/iPod/iPad</title>
		<link>http://c.gzl.name/archives/579</link>
		<comments>http://c.gzl.name/archives/579#comments</comments>
		<pubDate>Sat, 03 Jul 2010 22:53:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Webkit]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[userAgent]]></category>

		<guid isPermaLink="false">http://c.gzl.name/?p=579</guid>
		<description><![CDATA[PHP的比较简单可爱: if &#40;strpos&#40;$_SERVER&#91;'HTTP_USER_AGENT'&#93;,&#34;iPhone&#34;&#41;&#41; &#123; echo '在用户代理信息里面如果有iPhone, 执行您的代码'; //别忘了给iPod和iPad也加上去当条件阿~~ &#125; javascript的也不错,不过我一直不喜欢浪费太多的iPhone资源,不过这回佛典的html文件还是需要使用javascript,因为所有的xml文件都是简单的转换成html,如果再将php搀和进来就很麻烦了 if&#40;&#40;navigator.userAgent.match&#40;/iPhone/i&#41;&#41; &#124;&#124; &#40;navigator.userAgent.match&#40;/iPod/i&#41;&#41;&#41; &#123; document.write&#40;navigator.userAgent&#41;; &#125; else &#123; document.write&#40;navigator.userAgent&#41;; &#125; 我们可以看一下上面代码的输出: 如果是一台Mac: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.86 Safari/533.4 如果是一台iPhone: Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9(KHTML, like Gecko) Version/4.0.5 Mobile/8A293 [...]]]></description>
		<wfw:commentRss>http://c.gzl.name/archives/579/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>用Icon Composer制作Mac/iPhone程序图标</title>
		<link>http://c.gzl.name/archives/493</link>
		<comments>http://c.gzl.name/archives/493#comments</comments>
		<pubDate>Tue, 05 Jan 2010 03:58:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Cocoa开发]]></category>
		<category><![CDATA[iPhone开发]]></category>
		<category><![CDATA[小窍门]]></category>
		<category><![CDATA[Icon]]></category>
		<category><![CDATA[Icon Composer]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[图标]]></category>

		<guid isPermaLink="false">http://c.gzl.name/?p=493</guid>
		<description><![CDATA[上传过App Store的人还记得自己需要制作的各种尺寸的图标么？ 制作Mac/iPhone的图标的工作就不用Firework/Photoshop了吧&#8230; 对！Apple的Developer文件夹不是白给的！（冷静&#8230;） 请大家找到Icon Composer，下面是路径～～ 打开这个程序，不是很帅的程序，五个方块&#8230; 大家可以看到Mac程序中需要的各种尺寸的图标咯，怎么用呢？很简单拉～ 拽一个图片进去就自动变成那个尺寸了，顺便说一下：试试png，别用jpg&#8230; 我知道这个长方的图标很2，我手头就是这个墙纸了&#8230;方格间可以随便拽～～ 看到自己喜欢的尺寸了么？文件-&#62;保存成icon文件就可以咯！哇啦～～]]></description>
		<wfw:commentRss>http://c.gzl.name/archives/493/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>iPhone的一些新书</title>
		<link>http://c.gzl.name/archives/479</link>
		<comments>http://c.gzl.name/archives/479#comments</comments>
		<pubDate>Fri, 01 Jan 2010 06:24:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone开发]]></category>
		<category><![CDATA[书]]></category>

		<guid isPermaLink="false">http://c.gzl.name/?p=479</guid>
		<description><![CDATA[APress看样是打算和iPhone开发biao上了，除了N本新书，而且品质异常的高。最近我太偷懒了，也是很忙，博客这又没弄了，有空将APress这些书的读书笔记写上来与大家分享 这么多水果，看样是对身体非常好咯～ 期待APress更多的iPhone书籍，如果需要这些书，只需要google一下“书名+pdf”就会有惊喜哟！]]></description>
		<wfw:commentRss>http://c.gzl.name/archives/479/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>博文重开，献上MyFodian 0.4的源代码</title>
		<link>http://c.gzl.name/archives/475</link>
		<comments>http://c.gzl.name/archives/475#comments</comments>
		<pubDate>Mon, 02 Nov 2009 05:21:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone开发]]></category>
		<category><![CDATA[我的工程]]></category>
		<category><![CDATA[源代码]]></category>
		<category><![CDATA[MyFodian]]></category>

		<guid isPermaLink="false">http://c.gzl.name/?p=475</guid>
		<description><![CDATA[说来一个多月都没有更新自己的博客了，好多朋友都在支持我，鼓励我的博文，自己很开心。 生计的问题基本得到了解决，感情的问题也不再是问题（被人爱的感觉好阿！）所以之后一旦有时间是继续写博客。自己倒是没从开发中赚多少钱，但是希望大家有钱赚，希望大家从中获益就好。 我享受开发的乐趣！ 噢，源代码MyFodian0.4 话说这个程序还是非常粗糙的，不过对于初学者来说会是一个不错的实例。大家自己如果想编译，记得先更改320库的位置。如果320库工作不正常，就要麻烦你们自己改改那个MockDataSource了，因为320的版本更新快，很多东西都有可能会不好用。 预告一下，很多朋友都提了问题，有空归纳一下然后一起回答～ 挑会的答，嘿嘿]]></description>
		<wfw:commentRss>http://c.gzl.name/archives/475/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>数据类型/对象类型介绍（2）UINavigationController</title>
		<link>http://c.gzl.name/archives/373</link>
		<comments>http://c.gzl.name/archives/373#comments</comments>
		<pubDate>Sun, 06 Sep 2009 23:42:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[07 - 各种导航控制器（Nav,TabBar）]]></category>
		<category><![CDATA[iPhone开发]]></category>
		<category><![CDATA[UINavigationController]]></category>
		<category><![CDATA[导航控制器]]></category>
		<category><![CDATA[导航栏]]></category>

		<guid isPermaLink="false">http://c.gzl.name/?p=373</guid>
		<description><![CDATA[UINavigationController iPhone导航控制器/导航栏 是在iPhone程序中广为使用的用户数据互动方式。 这是一个简单的导航栏截图，我们可以设置其内置UIView的title，而导航栏会显示出这个title。而不是设置导航栏的title。我们也可以设置其左侧，或者右侧的按钮或者自定义视图对象。我们下面来一步一步的看看导航栏的使用： 1，创建并使用一个UINavigationController UINavigationController *aNav = &#91;&#91;UINavigationController alloc&#93; init&#93;; 然后添加一个视图进去，否则导航栏也没有意义的 UIViewController *aView = &#91;&#91;UIView alloc&#93; initWithNibName: &#40;*xib文件名*&#41;&#93;; &#91;aNav pushViewController:aView animated:NO&#93;; //导航栏的第一个视图不要动画化 2，设置导航栏的左右按钮： 我说过，设置导航栏的按钮并不是去设置导航栏本身，而是当时被导航的视图控制器，比如我们对aView作设置。 设置其标题： aView.title = @&#34;标题&#34;; &#160; //配置一个按钮，我这里是《我的佛典》上的代码 UIBarButtonItem *callModalViewButton = &#91;&#91;UIBarButtonItem alloc&#93; initWithTitle:@&#34;经文&#34; style:UIBarButtonItemStyleBordered target:self action:@selector&#40;callModalList&#41;&#93;; self.navigationItem.leftBarButtonItem = callModalViewButton; &#91;callModalViewButton release&#93;; //由于本地视图会retain它，所以我们可以release了 可以看到，还是很简单的嘛。 3，其他常用方法和属性： 本地视图.navigationItem.leftBarButtonItem //左边栏项目 本地视图.navigationItem.rightBarButtonItem //右边栏项目 本地视图.navigationItem.backBarButtonItem //后退栏项目 本地视图.navigationItem.hidesBackButton [...]]]></description>
		<wfw:commentRss>http://c.gzl.name/archives/373/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>makeKeyAndVisible</title>
		<link>http://c.gzl.name/archives/466</link>
		<comments>http://c.gzl.name/archives/466#comments</comments>
		<pubDate>Sun, 06 Sep 2009 23:14:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[05 - 视图（View）]]></category>
		<category><![CDATA[09 - 视图/绘图]]></category>
		<category><![CDATA[Cocoa开发]]></category>
		<category><![CDATA[iPhone开发]]></category>
		<category><![CDATA[makeKeyAndVisible]]></category>

		<guid isPermaLink="false">http://c.gzl.name/?p=466</guid>
		<description><![CDATA[我不知道为什么，不过有人搜索makeKeyAndVisible方法。其实我这种懒人一般不会刨根问底，有些方法照打就好，那些白给的方法有些就别动就好了。 我们看看这个每个程序都有的方法吧： &#91;window makeKeyAndVisible&#93;; 由于iPhone是单窗口程序，所以也就只有这么一个Window对象，而且是UIWindow，不是NSWindow。而根据文档上所说： “这个是便捷方法，去使被使用对象的主窗口显示到屏幕的最前端。你也可以使用hiddenUIView方法隐藏这个窗口” 所以基本上来说，对于编程者的区别仅仅在于在其前添加代码，或在其后添加代码。]]></description>
		<wfw:commentRss>http://c.gzl.name/archives/466/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Three20添加方法（翻译）</title>
		<link>http://c.gzl.name/archives/389</link>
		<comments>http://c.gzl.name/archives/389#comments</comments>
		<pubDate>Sun, 06 Sep 2009 06:09:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Three20库]]></category>
		<category><![CDATA[iPhone开发]]></category>
		<category><![CDATA[320]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[Three20]]></category>
		<category><![CDATA[框架]]></category>

		<guid isPermaLink="false">http://c.gzl.name/?p=389</guid>
		<description><![CDATA[Three20是一个iPhone开发图形接口类的集合，包含图片查看，一般工具，HTTP本地缓存。Three20是来自于Facebook的iPhone程序源代码的。 添加Three20到您的程序 ============================== Three20是预编译静态库，最简单的方法是使用Xcode的依赖工程特性，下面是方法： 1. 复制（Clone命令）three20 git（GitHub） 目录: `git clone git://github.com/joehewitt/three20.git`.  确保将其储存在一个常用位置，以便Xcode每次编译时来索引和访问 2. 在 &#8220;three20/src&#8221;中找到 &#8220;Three20.xcodeproj&#8221; . 拖拽Three20.xcodeproj到您工程的根目录&#8221;Groups and Files&#8221;边栏中.在弹出对话框中去掉&#8221;Copy items&#8221;的对号，&#8221;Reference Type&#8221;选择&#8221;Relative to Project&#8221;然后点“Add”. 3. 现在要链接Three20库到您的工程。点击添加进来的&#8221;Three20.xcodeproj&#8221;，在“Details”表中，你会看到 libThree20.a. 打上文件右侧的对号 4. 现在你需要设置320库为你程序的依赖库，以便Xcode在编译的时候也会将320一起编译起来。展开左侧的“Targets”标签，双击您程序的“目标”文件。在“General”标签下，你会看到“Direct Dependencies”，点“+”号添加320库。 5. 现在你需要添加图片和字符串包到你的程序，找到&#8221;Three20.bundle&#8221;在&#8221;three20/src&#8221;中，然后拖拽到你的程序中。对话框里面“Copy items”别选，“reference type”选“relative to project” 6. 现在，你需要添加 Core Animation framework到你的工程。点击程序target，然后在frameworks里面添加 QuartzCore.framework就可以了（这个不是翻译的，原来的方法太麻烦了 7. 最后，我们需要让你的工程找得到320库的文件头。打开 &#8220;Project Settings&#8221;找到&#8221;Build&#8221;标签，找到 &#8220;Header Search Paths&#8221;双击它。添加到&#8221;three20/src&#8221;相对目录的地址。 8. 当你在 Project Settings, 找到 [...]]]></description>
		<wfw:commentRss>http://c.gzl.name/archives/389/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在iPhone程序上读取PDF文件 (rev0.1 ^-^;)</title>
		<link>http://c.gzl.name/archives/460</link>
		<comments>http://c.gzl.name/archives/460#comments</comments>
		<pubDate>Sun, 06 Sep 2009 05:57:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[05 - 视图（View）]]></category>
		<category><![CDATA[09 - 视图/绘图]]></category>
		<category><![CDATA[Cocoa开发]]></category>
		<category><![CDATA[iPhone开发]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[Q2D]]></category>
		<category><![CDATA[Quartz 2D]]></category>

		<guid isPermaLink="false">http://c.gzl.name/?p=460</guid>
		<description><![CDATA[老话，最近闹心的事情多，开心的事情少，但是正事还是要干的。学习得需要，努力的需要，钱的需要&#8230; &#8230; 天上给我下点儿钞票吧！ 言归正传，怎么在iPhone程序中读取PDF的内容呢？答案是，苹果为我们准备了一个很神奇的framework Q2D（Quartz 2D）。Q2D提供了全套的PDF读取API，接下来我们来看看如果简单的使用Q2D来读取PDF文件： 我建立了一个工程叫iPhonePDF, 添加了一个UIScrollView（不知道怎么添加UIScrollView? 添加一个UIView然后把interface上的UIView改成UIScrollView就可以啦&#8230;）名为PDFView 看看PDFView里面有什么吧 @interface PDFView : UIScrollView &#123; &#160; NSString *filePath; CGPDFDocumentRef pdfDocument; CGPDFPageRef page; int pageNumber; &#125; &#160; @property &#40;copy, nonatomic&#41; NSString *filePath; @property int pageNumber; &#160; -&#40;CGPDFDocumentRef&#41;MyGetPDFDocumentRef; -&#40;void&#41;reloadView; -&#40;IBAction&#41;goUpPage:&#40;id&#41;sender; -&#40;IBAction&#41;goDownPage:&#40;id&#41;sender; @end filePath是储存pdf文件的位置的，得到文件位置就是老话题了：[NSBundle mainBundle]&#8230; 后面的会写吧&#8230; 不记得了在我博客里面搜索吧 CGPDFDocumentRef是PDF文档索引文件，Q2D是Core Foundation的API，所以没看到那个星星～ CGPDFPageRef是PDF页面索引文件 pageNumber是页码 下面的几个函数其实一看就明了了，翻页的，和刷新页面的。第一个是自定义的getter 然后我们看看m文件里面有用的方法： @implementation PDFView @synthesize filePath,pageNumber; &#160; [...]]]></description>
		<wfw:commentRss>http://c.gzl.name/archives/460/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>循环使用整个NSArray内的对象</title>
		<link>http://c.gzl.name/archives/450</link>
		<comments>http://c.gzl.name/archives/450#comments</comments>
		<pubDate>Fri, 04 Sep 2009 01:08:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[02 - Objective-C]]></category>
		<category><![CDATA[Cocoa开发]]></category>
		<category><![CDATA[iPhone开发]]></category>
		<category><![CDATA[loop]]></category>
		<category><![CDATA[NSArray]]></category>
		<category><![CDATA[NSEnumerator]]></category>
		<category><![CDATA[循环]]></category>

		<guid isPermaLink="false">http://c.gzl.name/?p=450</guid>
		<description><![CDATA[循环使用整个NSArray内的对象是非常常用的了，而且最近我在研究究竟怎么能方便的把NSArray存入Core Data，所以这更是必要了，看看如下的方法吧： 1，Objective-C 2.0法，最应该使用的 NSArray *aArray; //我们的Array，假设他已经初始化有内容了 &#160; for&#40;id innerObj in aArray&#41; //id可以由其他对象类型替代 &#123; //也就是说, 在循环中的参数innerObj就是aArray中的对象 //由于NSArray中只能储存对象，所以我们使用id作为内涵对象的类型，其实就是个指针了 //而且如果NSArray中的内容不一致，id更不会出现冲突 &#125; 2，C的老方法，不推荐，低性能 NSArray *aArray; //我们的Array，假设他已经初始化有内容了 &#160; for&#40;int i=0;i&#60;&#91;aArray count&#93;; i++&#41; &#123; &#91;&#91;aArray objectAtIndex:i&#93; 然后作你想作的事情&#93;; //做爱 作的事情... &#125; 3, 用NSEnumerator（不知道怎么翻译阿&#8230;.） NSEnumerator* myIterator = &#91;myArray reverseObjectEnumerator&#93;; id anObject; &#160; while&#40; anObject = &#91;myIterator nextObject&#93;&#41; //每次读取“逐读器”的下一个对象 &#123; //anObject和刚才的innerObj是一个意思，但是看看多了这么多行 &#125; 结语： [...]]]></description>
		<wfw:commentRss>http://c.gzl.name/archives/450/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

