<?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>Hackdiary &#187; iphone</title>
	<atom:link href="http://www.hackdiary.com/category/iphone/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hackdiary.com</link>
	<description></description>
	<lastBuildDate>Thu, 12 Aug 2010 08:58:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>iPhone coding for web developers</title>
		<link>http://www.hackdiary.com/2009/03/28/iphone-coding-for-web-developers/</link>
		<comments>http://www.hackdiary.com/2009/03/28/iphone-coding-for-web-developers/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 14:06:16 +0000</pubDate>
		<dc:creator>Matt Biddulph</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[talks]]></category>

		<guid isPermaLink="false">http://www.hackdiary.com/?p=179</guid>
		<description><![CDATA[This week the London Flash Platform User Group ran an evening of iPhone developer talks. My talk, &#8220;iPhone Coding For Web Developers&#8221; seemed to go down well. As a web developer, I&#8217;ve found the iPhone development environment exciting in its power and possibilities, but also perplexing in its lack of basic facilities that I&#8217;d take [...]]]></description>
			<content:encoded><![CDATA[<p>This week the <a href="http://www.lfpug.com/">London Flash Platform User Group</a> ran an evening of iPhone developer talks. My talk, &#8220;iPhone Coding For Web Developers&#8221; seemed to go down well. As a web developer, I&#8217;ve found the iPhone development environment exciting in its power and possibilities, but also perplexing in its lack of basic facilities that I&#8217;d take for granted in a modern dynamic language. </p>
<p>This talk (based on a <a href="http://www.hackdiary.com/2009/01/26/switching-from-scripting-languages-to-objective-c-and-iphone-useful-libraries/">previous blog post here</a>) goes into some detail about how I use HTTP, JSON and other web-oriented tech in my iPhone work.</p>
<div style="width:500px;text-align:left" id="__ss_1205996"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/mattb/iphone-coding-for-web-developers?type=presentation" title="iPhone Coding For Web Developers">iPhone Coding For Web Developers</a><object style="margin:0px" width="500" height="417"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=iphonecodingforwebdevelopers-090326190135-phpapp01&#038;rel=0&#038;stripped_title=iphone-coding-for-web-developers" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=iphonecodingforwebdevelopers-090326190135-phpapp01&#038;rel=0&#038;stripped_title=iphone-coding-for-web-developers" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="500" height="417"></embed></object>
<div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">presentations</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/mattb">mattb</a>.</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.hackdiary.com/2009/03/28/iphone-coding-for-web-developers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Switching from scripting languages to Objective C and iPhone: useful libraries</title>
		<link>http://www.hackdiary.com/2009/01/26/switching-from-scripting-languages-to-objective-c-and-iphone-useful-libraries/</link>
		<comments>http://www.hackdiary.com/2009/01/26/switching-from-scripting-languages-to-objective-c-and-iphone-useful-libraries/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 23:17:36 +0000</pubDate>
		<dc:creator>Matt Biddulph</dc:creator>
				<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://www.hackdiary.com/?p=118</guid>
		<description><![CDATA[For the last few months I&#8217;ve been spending much of my spare hacking time learning to code iPhone applications. I&#8217;ve found Objective C to be a surprisingly pleasant language, and Cocoa is one of the best frameworks I&#8217;ve ever worked with. I&#8217;ve reached a point where I feel I can go fairly quickly from simple [...]]]></description>
			<content:encoded><![CDATA[<p>For the last few months I&#8217;ve been spending much of my spare hacking time learning to code iPhone applications. I&#8217;ve found Objective C to be a surprisingly pleasant language, and Cocoa is one of the best frameworks I&#8217;ve ever worked with. I&#8217;ve reached a point where I feel I can go fairly quickly from simple app ideas to sketching in real code.</p>
<p>I&#8217;m a web developer at heart, and a scripting language user by preference. Coding for the iPhone doesn&#8217;t feel as fluid in text handling or HTTP access as the environments I&#8217;m used to. Fortunately I&#8217;ve been able to find some fantastic open-source libraries and wrappers that make up the difference. Here are my favourites so far:</p>
<h3>GTMHTTPFetcher from <a href="http://code.google.com/p/google-toolbox-for-mac/">Google Toolbox for Mac</a></h3>
<p>The iPhone&#8217;s <a href="http://developer.apple.com/documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html">native HTTP handling</a> is capable, but low-level and verbose. Rather than handling the many callbacks, NSData objects and options I prefer this wrapper. It has a ton of convenience methods allowing you to specify POST data and basic auth, follow redirects automatically, keep cookies over a session, set headers, and have two simple callbacks for success and error handling. In many ways it&#8217;s comparable to <a href="http://docs.jquery.com/Ajax/jQuery.ajax">jQuery&#8217;s $.ajax() one-hit function</a>. </p>
<h3><a href="http://code.google.com/p/json-framework/">JSON framework</a></h3>
<p>Having got some data over HTTP from a web API, chances are that it&#8217;s available in JSON format. This simple framework extends NSString with a <code>JSONValue</code> method to convert any legal JSON string to nested NSDictionaries and NSArrays. To go the other way, dictionaries and arrays gain a <code>JSONRepresentation</code> method.</p>
<h3>libxml2 wrappers for <a href="http://cocoawithlove.com/2008/10/using-libxml2-for-parsing-and-xpath.html">XPath over XML and HTML</a></h3>
<p>Perhaps your web API returns XML, or perhaps you&#8217;re getting your data by screenscraping HTML. Did you know that the iPhone ships with libxml2, which has high-performance XML and HTML parsing and a high-quality XPath implementation? Don&#8217;t struggle with Cocoa&#8217;s NSXMLParser or get bogged down in the complex libxml2 docs; use these two simple wrapper functions, <code>PerformXMLXPathQuery</code> and <code>PerformHTMLXPathQuery</code>, to pull out the structured data you need in a Cocoa-friendly representation.</p>
<h3><a href="http://regexkit.sourceforge.net/RegexKitLite/">RegexKitLite</a> for regular expressions</h3>
<p>Where would scripting be without regular expressions? Luckily they&#8217;re available on the iPhone, but buried deep within the <a href="http://www.icu-project.org/">ICU libraries</a>. RegexKitLite extends NSString with core regex string handling, including &#8216;split&#8217; (known as <code>componentsSeparatedByRegex</code>) and a search-and-replace operator (<code>stringByReplacingOccurrencesOfRegex</code> and <code>replaceOccurrencesOfRegex</code>).</p>
<h3><a href="http://flycode.googlecode.com/svn/trunk/fmdb/">FMDB</a>, an Objective C wrapper for sqlite</h3>
<p>Every scripting language has convenient database driver wrappers. I was very happy to find that sqlite is available on the iPhone, but unfortunately its interface is all bare-metal C.  The simplest wrapper I&#8217;ve found so far is FMDB. Apparently somewhat inspired by JDBC, it gives you connection and resultset objects, along with one-liner convenience functions allowing code like <code>[db intForQuery:@"SELECT COUNT(*) FROM things"]</code>.</p>
<h3>And there&#8217;s more&#8230;</h3>
<p>I&#8217;ve used all of the above in a real project, but I&#8217;ve got yet more things to explore on my todo list. These include <a href="http://mattgemmell.com/2008/05/20/mgtemplateengine-templates-with-cocoa">Matt Gemmell&#8217;s web-style templating framework MGTemplateEngine</a>, <a href="http://code.google.com/p/plactorkit/">ActorKit for Erlang-style messaging and thread management</a> and the <a href="http://www.oiledmachine.com/posts/2009/01/06/using-the-llvm-clang-static-analyzer-for-iphone-apps.html">LLVM/Clang Static Analyzer for automatic bug detection</a>. What else do you use?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackdiary.com/2009/01/26/switching-from-scripting-languages-to-objective-c-and-iphone-useful-libraries/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
