<?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>The Brian Olore Story &#187; iphone</title>
	<atom:link href="http://brian.olore.net/wp/tag/iphone/feed/" rel="self" type="application/rss+xml" />
	<link>http://brian.olore.net</link>
	<description>Less of a story, more of a brain dump</description>
	<lastBuildDate>Sun, 18 Dec 2011 17:19:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>RailsConf &#8211; Day 1  &#8211; Mobile App Development with iPhone and Rails</title>
		<link>http://brian.olore.net/wp/2010/06/railsconf-day-1-mobile-dev/</link>
		<comments>http://brian.olore.net/wp/2010/06/railsconf-day-1-mobile-dev/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 02:42:37 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[work]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[railsconf]]></category>

		<guid isPermaLink="false">http://brian.olore.net/?p=139</guid>
		<description><![CDATA[Mike Clark http://en.oreilly.com/rails2010/public/schedule/detail/14136 This is going to be mostly an iPhone application development session, not Rails. Demo app is performs CRUD operations on a Rails 3 site from an iPhone app http://github.com/clarkware/iphone-rails-tutorial Basic Railsy JSON controller methods Standard iPhone callback methods: applicationWillTerminate, didFinishLaunchingWithOptions in .h file &#8211; create instance variables in the @interface and add: [...]]]></description>
			<content:encoded><![CDATA[<p>Mike Clark http://en.oreilly.com/rails2010/public/schedule/detail/14136</p>
<p>This is going to be mostly an iPhone application development session, not Rails.<br />
Demo app is performs CRUD operations on a Rails 3 site from an iPhone app</p>
<p>http://github.com/clarkware/iphone-rails-tutorial</p>
<p>Basic Railsy JSON controller methods</p>
<p>Standard iPhone callback methods: applicationWillTerminate, didFinishLaunchingWithOptions</p>
<p>in .h file &#8211; create instance variables in the @interface and add:<br />
@property(nonatomic, retain) NSMutableArray *goals;</p>
<p>in .m use: @synthesize goals (initializes instance variable), also release in dealloc()</p>
<p>viewDidLoad &#8211; called when the view is loaded<br />
reference &#8220;goals&#8221; with &#8220;self.goals&#8221; to access variable through property</p>
<p>&#8220;Do not fear the square brackets&#8221;</p>
<p>cellForRowAtIndexPath &#8211; don&#8217;t delete what&#8217;s there (that&#8217;s what makes scrolling through large list fast), just add your own logic to the end of the method, before &#8220;return cell&#8221;;</p>
<p>commitEditingStyle &#8211; delete from our array &#8211; allows deletion in app. Restart app to get data back (since it&#8217;s in memory)</p>
<p>StringWithContentsOfURL &#8211; fetch URL synchronously (blocks main UI thread)<br />
json-framework is a strict JSON parser and generator<br />
return NSDictionary or NSArray of NSDictionaries</p>
<p>refreshButton &#8211; &#8220;action:@selector(refresh)&#8221; &#8212; is like using &#8220;send&#8221; in ruby. target:self&#8221; means that self.refresh will be called on click</p>
<p>networkActivityIndicatorVisible &#8211; network spinner</p>
<p>NSURLRequest, NSURLConnection, sendSynchronousRequest</p>
<p>Shift &#8211; Apple &#8211; R brings up debug console in Xcode</p>
<p>After break &#8211; Asynchronous Networking, Authentication, Error handling &#8230;.</p>
<p>Async Networking &#8211; done with the Delegate pattern &#8211; http://en.wikipedia.org/wiki/Delegation_pattern</p>
<p>Use an OperationQueue to background work &#8211; NSOperationQueue, NSInvocationOperation &#8211; don&#8217;t use NSThread<br />
Always update the UI on the main thread &#8211; performSelectorMainThread</p>
<p>HTTPRiot is a simple REST library that makes it easy to interact with RESTful resources (inspired by httparty) &#8211; responses converted to NSDictionary and NSArray objects.</p>
<p>http://allseeing-i.com/ASIHTTPRequest/ &#8211; flexible, low-level library with tons of features &#8211; File uploads, post form-encoded data, basic authentication,  progress indictors, etc. Not REST specific, doesn&#8217;t handle json/xml by default, but very useful for low-level stuff<a href="http://github.com/yfactorial/objectiveresource"></a></p>
<p><a href="http://github.com/yfactorial/objectiveresource">ObjectiveResource</a> is an Objective-C port of <a href="http://api.rubyonrails.org/classes/ActiveResource/Base.html">ActiveResource</a> &#8211; Automatically serializes/deserializes objects (to/from JSON or XML) &#8211; Assumes Rails RESTful conventions &#8211; adds methods to NSObject</p>
<p>didFinishLaunchWithOptions &#8211; only gets called once &#8211; when app starts up</p>
<p>ObjectiveResource needs the following to give json a default root object:<br />
<code>ActiveRecord::Base.include_root_in_json = </code><code>true</code></p>
]]></content:encoded>
			<wfw:commentRss>http://brian.olore.net/wp/2010/06/railsconf-day-1-mobile-dev/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

