<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Dizzey.com</title>
	
	<link>http://www.dizzey.com</link>
	<description>iOS development &amp; tech junkie thoughts</description>
	<lastBuildDate>Mon, 28 Nov 2011 17:42:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/dizzey" /><feedburner:info uri="dizzey" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><image><link>http://www.dizzey.com/</link><url>http://www.dizzey.com/images/logo.png</url><title>Dizzey.com</title></image><item>
		<title>Consuming RESTful API with RESTframework</title>
		<link>http://feedproxy.google.com/~r/dizzey/~3/tvhLelDOtrE/</link>
		<comments>http://www.dizzey.com/development/ios/consuming-restful-api-with-restframework/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 17:42:07 +0000</pubDate>
		<dc:creator>Ivan</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[cocoa-touch]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[ipod]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[snippets]]></category>
		<category><![CDATA[webservice]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://www.dizzey.com/?p=582</guid>
		<description><![CDATA[As explained in previous post, we&#8217;re going to demonstrate how RESTframework handles REST web services. I&#8217;ll be consuming a simple Django demo web service created in previous post, so either grab the sources or read the post and build it &#8230; <a href="http://www.dizzey.com/development/ios/consuming-restful-api-with-restframework/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As explained in previous post, we&#8217;re going to demonstrate how <a title="RESTframework for Cocoa and Cocoa Touch" href="https://github.com/ivasic/RESTframework">RESTframework</a> handles REST web services. I&#8217;ll be consuming a simple Django demo web service created in <a title="Building RESTful API with Django" href="http://www.dizzey.com/development/building-restful-api-with-django/">previous post</a>, so either grab the sources or read the post and build it yourself. Assuming you have this service running on localhost, port 8000, we can continue.</p>
<p>First, download RESTframework from GitHub. With git client, simply type in terminal:</p>

<div class="wp_codebox"><table><tr id="p5824"><td class="code" id="p582code4"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">git</span> clone <span style="color: #c20cb9; font-weight: bold;">git</span><span style="color: #000000; font-weight: bold;">@</span>github.com:ivasic<span style="color: #000000; font-weight: bold;">/</span>RESTframework.git</pre></td></tr></table></div>

<p>The quickest way to get RESTframework into your project is just including all the files from<em> RFClasses </em> folder. RF does not have any external dependencies so building shouldn&#8217;t be a problem.</p>
<div id="attachment_583" class="wp-caption aligncenter" style="width: 250px"><a href="http://www.dizzey.com/wp-content/uploads/2011/11/Screen-Shot-2011-11-27-at-10.51.22-AM.png"><img class="size-medium wp-image-583" title="RFClasses" src="http://www.dizzey.com/wp-content/uploads/2011/11/Screen-Shot-2011-11-27-at-10.51.22-AM-240x300.png" alt="RFClasses" width="240" height="300" /></a><p class="wp-caption-text">RFClasses</p></div>
<p>Now, we&#8217;ll also need <a href="https://github.com/johnezang/JSONKit">JSONKit</a> to parse API response and <a href="https://github.com/jdg/MBProgressHUD">MBProgressHUD</a> to show some progress. Grab both from GitHub and add to your project.</p>
<h2>Fetching objects list</h2>
<p>We&#8217;ll have 2 view controllers in our demo app. One will be a simple object list and the other one will be, even more simple, view controller for creating a new object. First, we&#8217;re going to show how to fetch the object list. We&#8217;ll need a GET request to /objects/ URL and we&#8217;ll need to parse the JSON array we get in response and show in the table view.</p>

<div class="wp_codebox"><table><tr id="p5825"><td class="code" id="p582code5"><pre class="objc" style="font-family:monospace;">RFRequest<span style="color: #002200;">*</span> r <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>RFRequest requestWithURL<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/"><span style="color: #400080;">NSURL</span></a> URLWithString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;http://localhost:8000/&quot;</span><span style="color: #002200;">&#93;</span> type<span style="color: #002200;">:</span>RFRequestMethodGet resourcePathComponents<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;objects&quot;</span>, <span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#91;</span>MBProgressHUD showHUDAddedTo<span style="color: #002200;">:</span>self.view animated<span style="color: #002200;">:</span><span style="color: #a61390;">YES</span><span style="color: #002200;">&#93;</span>.labelText <span style="color: #002200;">=</span> NSLocalizedString<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Loading...&quot;</span>, <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;&quot;</span><span style="color: #002200;">&#41;</span>;
<span style="color: #002200;">&#91;</span>RFService execRequest<span style="color: #002200;">:</span>r completion<span style="color: #002200;">:^</span><span style="color: #002200;">&#40;</span>RFResponse<span style="color: #002200;">*</span> response<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
	<span style="color: #002200;">&#91;</span>MBProgressHUD hideHUDForView<span style="color: #002200;">:</span>self.view animated<span style="color: #002200;">:</span><span style="color: #a61390;">YES</span><span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>response.error<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
		UIAlertView<span style="color: #002200;">*</span> aiv <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIAlertView alloc<span style="color: #002200;">&#93;</span> initWithTitle<span style="color: #002200;">:</span>NSLocalizedString<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Error&quot;</span>, <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;&quot;</span><span style="color: #002200;">&#41;</span> message<span style="color: #002200;">:</span>response.error.localizedDescription delegate<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span> cancelButtonTitle<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;OK&quot;</span> otherButtonTitles<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span> autorelease<span style="color: #002200;">&#93;</span>;
		<span style="color: #002200;">&#91;</span>aiv show<span style="color: #002200;">&#93;</span>;
		<span style="color: #a61390;">return</span>;
	<span style="color: #002200;">&#125;</span>
&nbsp;
	self.dataSource <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>response.dataValue objectFromJSONData<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>self.tableView reloadData<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span><span style="color: #002200;">&#93;</span>;</pre></td></tr></table></div>

<p>So, what we&#8217;re doing in this code snippet is:</p>
<ul>
<li>Creating a GET RFRequest with appropriate URL and resource path</li>
<li>Attaching MBProgressHUD to our view to show spinner progress</li>
<li>Executing RFRequest and defining the block to execute after RFResponse is received</li>
<li>Inside this block, we simply check for errors, parse the response, add to our tableView dataSource and reloading the table</li>
</ul>
<div>You can see all this in action in the project sample attached to this blog post (at the bottom).</div>
<h2>Creating new objects</h2>
<p>Our view controller for creating new objects is responsible for creating POST requests to /objects/ URL. Again, very simple, you just need to do this:</p>

<div class="wp_codebox"><table><tr id="p5826"><td class="code" id="p582code6"><pre class="objc" style="font-family:monospace;">RFRequest<span style="color: #002200;">*</span> r <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>RFRequest requestWithURL<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/"><span style="color: #400080;">NSURL</span></a> URLWithString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;http://localhost:8000/&quot;</span><span style="color: #002200;">&#93;</span> type<span style="color: #002200;">:</span>RFRequestMethodPost resourcePathComponents<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;objects&quot;</span>, <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;&quot;</span>, <span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #002200;">&#91;</span>r addParam<span style="color: #002200;">:</span>self.txtName.text forKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;name&quot;</span><span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#91;</span>r addParam<span style="color: #002200;">:</span>self.lblDate.text forKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;date&quot;</span><span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #002200;">&#91;</span>MBProgressHUD showHUDAddedTo<span style="color: #002200;">:</span>self.view animated<span style="color: #002200;">:</span><span style="color: #a61390;">YES</span><span style="color: #002200;">&#93;</span>.labelText <span style="color: #002200;">=</span> NSLocalizedString<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Submitting...&quot;</span>, <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;&quot;</span><span style="color: #002200;">&#41;</span>;
<span style="color: #002200;">&#91;</span>RFService execRequest<span style="color: #002200;">:</span>r completion<span style="color: #002200;">:^</span><span style="color: #002200;">&#40;</span>RFResponse<span style="color: #002200;">*</span> response<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
	<span style="color: #002200;">&#91;</span>MBProgressHUD hideHUDForView<span style="color: #002200;">:</span>self.view animated<span style="color: #002200;">:</span><span style="color: #a61390;">YES</span><span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>response.error<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
		UIAlertView<span style="color: #002200;">*</span> aiv <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIAlertView alloc<span style="color: #002200;">&#93;</span> initWithTitle<span style="color: #002200;">:</span>NSLocalizedString<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Error&quot;</span>, <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;&quot;</span><span style="color: #002200;">&#41;</span> message<span style="color: #002200;">:</span>response.error.localizedDescription delegate<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span> cancelButtonTitle<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;OK&quot;</span> otherButtonTitles<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span> autorelease<span style="color: #002200;">&#93;</span>;
		<span style="color: #002200;">&#91;</span>aiv show<span style="color: #002200;">&#93;</span>;
		<span style="color: #a61390;">return</span>;
	<span style="color: #002200;">&#125;</span>
&nbsp;
	UIAlertView<span style="color: #002200;">*</span> aiv <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIAlertView alloc<span style="color: #002200;">&#93;</span> initWithTitle<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Success&quot;</span> message<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Success&quot;</span> delegate<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span> cancelButtonTitle<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;OK&quot;</span> otherButtonTitles<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span> autorelease<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>aiv show<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #002200;">&#91;</span>self.navigationController popViewControllerAnimated<span style="color: #002200;">:</span><span style="color: #a61390;">YES</span><span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span><span style="color: #002200;">&#93;</span>;</pre></td></tr></table></div>

<p>Similar to our previous snippet, but this time we also add some parameters to the request &#8211; name and date strings.</p>
<p>This is a brief overview with sample Xcode project of how RESTframework consumes RESTful web APIs. Questions welcomed via comments as usual.</p>
<p>&nbsp;</p>
<p><strong>Download project: </strong><a href="http://www.dizzey.com/wp-content/uploads/2011/11/RESTframeworkDemoApp.zip">RESTframework demo Xcode project download</a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/9ElGNhWEodpTKifcjHr_7ecL400/0/da"><img src="http://feedads.g.doubleclick.net/~a/9ElGNhWEodpTKifcjHr_7ecL400/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/9ElGNhWEodpTKifcjHr_7ecL400/1/da"><img src="http://feedads.g.doubleclick.net/~a/9ElGNhWEodpTKifcjHr_7ecL400/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/dizzey/~4/tvhLelDOtrE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dizzey.com/development/ios/consuming-restful-api-with-restframework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.dizzey.com/development/ios/consuming-restful-api-with-restframework/</feedburner:origLink></item>
		<item>
		<title>Building RESTful API with Django</title>
		<link>http://feedproxy.google.com/~r/dizzey/~3/EHRs_tRljKs/</link>
		<comments>http://www.dizzey.com/development/building-restful-api-with-django/#comments</comments>
		<pubDate>Tue, 15 Nov 2011 13:40:54 +0000</pubDate>
		<dc:creator>Ivan</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[webservice]]></category>

		<guid isPermaLink="false">http://www.dizzey.com/?p=561</guid>
		<description><![CDATA[In order to demonstrate how RESTframework for Cocoa works, I&#8217;m going to create a small RESTful API demo in Django/Python and use that as a demo web service we&#8217;re gonna query from our soon-to-be demo iOS app. Hopefully, you can &#8230; <a href="http://www.dizzey.com/development/building-restful-api-with-django/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In order to demonstrate how <a title="REST framework for iOS is now Open Source" href="http://www.dizzey.com/development/ios/restframework-open-source/">RESTframework for Cocoa</a> works, I&#8217;m going to create a small RESTful API demo in Django/Python and use that as a demo web service we&#8217;re gonna query from our soon-to-be demo iOS app. Hopefully, you can also pick up a thing or two from this tutorial as well since Django seems to be a very powerful framework for building RESTful APIs with. If you don&#8217;t want to bother with Django, you can simply download the project (see the end of this post) and run it as a demo web service. Next post will explain how to use my RESTframework to consume this web service.</p>
<h2>Requirements</h2>
<p>You&#8217;ll need Python, of course, and I&#8217;ve tested this on v2.7 although I&#8217;m pretty sure it should also work on v2.6 and possibly v2.5. Then you&#8217;ll need <em>django</em> and <em>djangorestframework</em> both available for install with pip or easy_install.</p>
<h2>Django project</h2>
<p>Create a new django project and the first django app.</p>

<div class="wp_codebox"><table><tr id="p56116"><td class="code" id="p561code16"><pre class="bash" style="font-family:monospace;">$ django-admin.py startproject DjangoTest
$ <span style="color: #7a0874; font-weight: bold;">cd</span> DjangoTest
$ django-admin.py startapp api</pre></td></tr></table></div>

<p>Now we need to modify our initial project settings. For the sake of simplicity, I&#8217;ll be using SQLite3 database since it doesn&#8217;t require any installation or setup. To do this, edit settings.py in your project dir.</p>

<div class="wp_codebox"><table><tr id="p56117"><td class="code" id="p561code17"><pre class="python" style="font-family:monospace;">DATABASES = <span style="color: black;">&#123;</span>
    <span style="color: #483d8b;">'default'</span>: <span style="color: black;">&#123;</span>
        <span style="color: #483d8b;">'ENGINE'</span>: <span style="color: #483d8b;">'django.db.backends.sqlite3'</span>, <span style="color: #808080; font-style: italic;"># Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.</span>
        <span style="color: #483d8b;">'NAME'</span>: <span style="color: #483d8b;">'database.db'</span>,                      <span style="color: #808080; font-style: italic;"># Or path to database file if using sqlite3.</span>
        <span style="color: #483d8b;">'USER'</span>: <span style="color: #483d8b;">''</span>,                      <span style="color: #808080; font-style: italic;"># Not used with sqlite3.</span>
        <span style="color: #483d8b;">'PASSWORD'</span>: <span style="color: #483d8b;">''</span>,                  <span style="color: #808080; font-style: italic;"># Not used with sqlite3.</span>
        <span style="color: #483d8b;">'HOST'</span>: <span style="color: #483d8b;">''</span>,                      <span style="color: #808080; font-style: italic;"># Set to empty string for localhost. Not used with sqlite3.</span>
        <span style="color: #483d8b;">'PORT'</span>: <span style="color: #483d8b;">''</span>,                      <span style="color: #808080; font-style: italic;"># Set to empty string for default. Not used with sqlite3.</span>
    <span style="color: black;">&#125;</span>
<span style="color: black;">&#125;</span></pre></td></tr></table></div>

<p>Another thing we need to do in settings.py is to add your app and djangorestframework to the installed apps section.</p>

<div class="wp_codebox"><table><tr id="p56118"><td class="code" id="p561code18"><pre class="python" style="font-family:monospace;">INSTALLED_APPS = <span style="color: black;">&#40;</span>
    <span style="color: #483d8b;">'django.contrib.auth'</span>,
    <span style="color: #483d8b;">'django.contrib.contenttypes'</span>,
    <span style="color: #483d8b;">'django.contrib.sessions'</span>,
    <span style="color: #483d8b;">'django.contrib.sites'</span>,
    <span style="color: #483d8b;">'django.contrib.messages'</span>,
    <span style="color: #483d8b;">'django.contrib.staticfiles'</span>,
    <span style="color: #808080; font-style: italic;"># Uncomment the next line to enable the admin:</span>
    <span style="color: #808080; font-style: italic;"># 'django.contrib.admin',</span>
    <span style="color: #808080; font-style: italic;"># Uncomment the next line to enable admin documentation:</span>
    <span style="color: #808080; font-style: italic;"># 'django.contrib.admindocs',</span>
    <span style="color: #483d8b;">'DjangoTest.api'</span>,
    <span style="color: #483d8b;">'djangorestframework'</span>,
<span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>Okay, now let&#8217;s run and test if it worked.</p>

<div class="wp_codebox"><table><tr id="p56119"><td class="code" id="p561code19"><pre class="bash" style="font-family:monospace;">$ python manage.py runserver</pre></td></tr></table></div>

<p>Now go to http://localhost:8000/ and make sure you see &#8220;It worked&#8221; message.</p>
<p>Next step is creating some resources for our RESTful API. I&#8217;ve created a simple model to hold a name and creation date. Looks like this:</p>

<div class="wp_codebox"><table><tr id="p56120"><td class="code" id="p561code20"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">class</span> Object<span style="color: black;">&#40;</span>models.<span style="color: black;">Model</span><span style="color: black;">&#41;</span>:
	name = models.<span style="color: black;">CharField</span><span style="color: black;">&#40;</span>max_length=<span style="color: #ff4500;">50</span><span style="color: black;">&#41;</span>
	date = models.<span style="color: black;">DateTimeField</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>We&#8217;re almost there. We need to sync our database now after we&#8217;ve created the model (do this every time you change the model, see more info <a href="https://docs.djangoproject.com/en/dev/ref/django-admin/#syncdb" target="_blank">here</a>)</p>

<div class="wp_codebox"><table><tr id="p56121"><td class="code" id="p561code21"><pre class="bash" style="font-family:monospace;">$ python manage.py syncdb</pre></td></tr></table></div>

<h2>RESTful API using django-rest-framework</h2>
<p>Now our django project is ready. Using <a href="http://django-rest-framework.org/" target="_blank">djangorestframework</a> we will add RESTful API interface for our &#8216;api&#8217; app. Assuming you&#8217;ve installed it correctly, all we need to do is to create another python file where we will store our resources. Name it resources.py and put this inside:</p>

<div class="wp_codebox"><table><tr id="p56122"><td class="code" id="p561code22"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> djangorestframework.<span style="color: black;">resources</span> <span style="color: #ff7700;font-weight:bold;">import</span> ModelResource
<span style="color: #ff7700;font-weight:bold;">from</span> api.<span style="color: black;">models</span> <span style="color: #ff7700;font-weight:bold;">import</span> Object
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> ObjectResource<span style="color: black;">&#40;</span>ModelResource<span style="color: black;">&#41;</span>:
	model = Object
	fields = <span style="color: black;">&#40;</span><span style="color: #483d8b;">'name'</span>, <span style="color: #483d8b;">'date'</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>When this is done, we need to add some URLs where our resources will be located. I&#8217;m using nifty views provided by djangorestframework which work with your models without a single line of code. You get 2 URLs for viewing a list of objects (or creating a new one) and one for viewing your object details. urls.py looks like this:</p>

<div class="wp_codebox"><table><tr id="p56123"><td class="code" id="p561code23"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">conf</span>.<span style="color: black;">urls</span>.<span style="color: black;">defaults</span> <span style="color: #ff7700;font-weight:bold;">import</span> patterns, include, url
&nbsp;
<span style="color: #808080; font-style: italic;"># Uncomment the next two lines to enable the admin:</span>
<span style="color: #808080; font-style: italic;"># from django.contrib import admin</span>
<span style="color: #808080; font-style: italic;"># admin.autodiscover()</span>
<span style="color: #ff7700;font-weight:bold;">from</span> djangorestframework.<span style="color: black;">views</span> <span style="color: #ff7700;font-weight:bold;">import</span> ListOrCreateModelView, InstanceModelView
<span style="color: #ff7700;font-weight:bold;">from</span> api.<span style="color: black;">resources</span> <span style="color: #ff7700;font-weight:bold;">import</span> ObjectResource
&nbsp;
urlpatterns = patterns<span style="color: black;">&#40;</span><span style="color: #483d8b;">''</span>,
    <span style="color: #808080; font-style: italic;"># Examples:</span>
    <span style="color: #808080; font-style: italic;"># url(r'^$', 'DjangoTest.views.home', name='home'),</span>
    <span style="color: #808080; font-style: italic;"># url(r'^DjangoTest/', include('DjangoTest.foo.urls')),</span>
&nbsp;
    <span style="color: #808080; font-style: italic;"># Uncomment the admin/doc line below to enable admin documentation:</span>
    <span style="color: #808080; font-style: italic;"># url(r'^admin/doc/', include('django.contrib.admindocs.urls')),</span>
&nbsp;
    <span style="color: #808080; font-style: italic;"># Uncomment the next line to enable the admin:</span>
    <span style="color: #808080; font-style: italic;"># url(r'^admin/', include(admin.site.urls)),</span>
&nbsp;
    url<span style="color: black;">&#40;</span>r<span style="color: #483d8b;">'^objects/$'</span>, ListOrCreateModelView.<span style="color: black;">as_view</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">resource</span>=ObjectResource<span style="color: black;">&#41;</span>, name=<span style="color: #483d8b;">'object-root'</span><span style="color: black;">&#41;</span>,
    url<span style="color: black;">&#40;</span>r<span style="color: #483d8b;">'^objects/(?P[^/]+)/$'</span>, InstanceModelView.<span style="color: black;">as_view</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">resource</span>=ObjectResource<span style="color: black;">&#41;</span>, name=<span style="color: #483d8b;">'object'</span><span style="color: black;">&#41;</span>,
<span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>That&#8217;s it. Save and run your project and you&#8217;ll be able to access your resources at http://localhost:8000/objects/<br />
For example, querying an URL like this one (providing you added an object with id=1) http://localhost:8000/objects/1/?_accept=application/json would result in this:</p>

<div class="wp_codebox"><table><tr id="p56124"><td class="code" id="p561code24"><pre class="json" style="font-family:monospace;">{&quot;date&quot;: &quot;2011-11-28 09:38:21&quot;, &quot;name&quot;: &quot;Test&quot;}</pre></td></tr></table></div>

<h2>Download sample project</h2>
<p>Help yourself with the sources for this project ready to unzip &amp; run. You can download the project here &#8211; <a href="http://www.dizzey.com/wp-content/uploads/2011/11/DjangoTest.zip">DjangoRESTfulAPI</a>.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/Fu4kOIZcREYyvIs6rAB1rVWiC7A/0/da"><img src="http://feedads.g.doubleclick.net/~a/Fu4kOIZcREYyvIs6rAB1rVWiC7A/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Fu4kOIZcREYyvIs6rAB1rVWiC7A/1/da"><img src="http://feedads.g.doubleclick.net/~a/Fu4kOIZcREYyvIs6rAB1rVWiC7A/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/dizzey/~4/EHRs_tRljKs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dizzey.com/development/building-restful-api-with-django/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.dizzey.com/development/building-restful-api-with-django/</feedburner:origLink></item>
		<item>
		<title>REST framework for iOS is now Open Source</title>
		<link>http://feedproxy.google.com/~r/dizzey/~3/_dJOHOUQyAU/</link>
		<comments>http://www.dizzey.com/development/ios/restframework-open-source/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 11:58:04 +0000</pubDate>
		<dc:creator>Ivan</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[cocoa-touch]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[restful]]></category>
		<category><![CDATA[webservice]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://www.dizzey.com/?p=556</guid>
		<description><![CDATA[I have (finally) open sourced my RESTframework project on GitHub. It aims for simplicity of usage primarily. Querying RESTful web services is really easy now. Supported are iOS versions 4.0 and above and Mac OS 10.6 and above. Feel free &#8230; <a href="http://www.dizzey.com/development/ios/restframework-open-source/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have (finally) open sourced my <a title="RESTframework" href="https://github.com/ivasic/RESTframework" target="_blank">RESTframework</a> project on GitHub. It aims for simplicity of usage primarily. Querying RESTful web services is really easy now. Supported are iOS versions 4.0 and above and Mac OS 10.6 and above.</p>
<p>Feel free to fork &amp; contribute!</p>
<p><a title="RESTframework on GitHub" href="https://github.com/ivasic/RESTframework" target="_blank">RESTframework on GitHub</a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/2cBoKsqJdqVgfRbr_YbMC4MLS7M/0/da"><img src="http://feedads.g.doubleclick.net/~a/2cBoKsqJdqVgfRbr_YbMC4MLS7M/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/2cBoKsqJdqVgfRbr_YbMC4MLS7M/1/da"><img src="http://feedads.g.doubleclick.net/~a/2cBoKsqJdqVgfRbr_YbMC4MLS7M/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/dizzey/~4/_dJOHOUQyAU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dizzey.com/development/ios/restframework-open-source/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.dizzey.com/development/ios/restframework-open-source/</feedburner:origLink></item>
		<item>
		<title>XCode 4 themes</title>
		<link>http://feedproxy.google.com/~r/dizzey/~3/F2LB9WcyIYE/</link>
		<comments>http://www.dizzey.com/development/xcode-4-themes/#comments</comments>
		<pubDate>Mon, 25 Apr 2011 20:04:22 +0000</pubDate>
		<dc:creator>Ivan</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[look & feel]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://www.dizzey.com/?p=543</guid>
		<description><![CDATA[I was searching for some cool XCode 4 themes I could use cause the default ones are pretty boring so I thought I&#8217;d share what I found with my readers. My favorite (for now) is the Spacedust theme by m5h Some &#8230; <a href="http://www.dizzey.com/development/xcode-4-themes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was searching for some cool XCode 4 themes I could use cause the default ones are pretty boring so I thought I&#8217;d share what I found with my readers.</p>
<p>My favorite (for now) is the <a href="http://disqus.com/forums/simplyhacking/spacedust_xcode_theme_79/trackback/" target="_blank">Spacedust</a> theme by <a href="https://gist.github.com/m5h">m5h</a></p>
<p><a href="http://simplyhacking.com/images/posts/spacedust-xcode-theme.png"><img class="aligncenter" title="Spacedust XCode 4 theme" src="http://simplyhacking.com/images/posts/spacedust-xcode-theme.png" alt="" width="734" height="634" /></a></p>
<p>Some other really interesting themes:</p>
<ul>
<li><a href="http://disqus.com/forums/enormego-developers/ego_xcode_theme_for_xcode_4_egov2_enormegodevelopers/trackback/" target="_blank">EGO</a></li>
<li>Dark theme from <a href="http://scotchandcode.com/2011/02/17/dark-xcode-4-theme/" target="_blank">Scotch and Code</a></li>
<li><a href="http://code.coneybeare.net/quo-xcode-theme-update-for-xcode-4" target="_blank">Coneybeare</a></li>
<li><a href="https://github.com/jbrennan/xcode4themes" target="_blank">jbrennan&#8217;s</a> collection of themes (really cool)</li>
</ul>
<p>If you have an &#8216;old&#8217; XCode 3 theme you&#8217;d like to use with XCode 4, I&#8217;m sure <a href="http://macindie.com/2011/01/porting-color-themes-to-xcode-4/" target="_blank">this</a> will help.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/FBIoRo_5g2Wrnm7hZHxDIJlpJos/0/da"><img src="http://feedads.g.doubleclick.net/~a/FBIoRo_5g2Wrnm7hZHxDIJlpJos/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/FBIoRo_5g2Wrnm7hZHxDIJlpJos/1/da"><img src="http://feedads.g.doubleclick.net/~a/FBIoRo_5g2Wrnm7hZHxDIJlpJos/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/dizzey/~4/F2LB9WcyIYE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dizzey.com/development/xcode-4-themes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.dizzey.com/development/xcode-4-themes/</feedburner:origLink></item>
		<item>
		<title>Cleaning up XCode 4 user data from VCS (git)</title>
		<link>http://feedproxy.google.com/~r/dizzey/~3/M7yJB6kMeGM/</link>
		<comments>http://www.dizzey.com/development/cleaning-up-xcode-4-user-data-from-vcs-git/#comments</comments>
		<pubDate>Tue, 19 Apr 2011 16:10:15 +0000</pubDate>
		<dc:creator>Ivan</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://www.dizzey.com/?p=530</guid>
		<description><![CDATA[If you use a version control system for your XCode 4 projects (and if you don&#8217;t I suggest you start) you&#8217;d probably want to keep your VCS state clean and omit committing user specific settings/files that XCode automatically creates. With &#8230; <a href="http://www.dizzey.com/development/cleaning-up-xcode-4-user-data-from-vcs-git/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you use a version control system for your XCode 4 projects (and if you don&#8217;t I suggest you start) you&#8217;d probably want to keep your VCS state clean and omit committing user specific settings/files that XCode automatically creates. With XCode 3 you were probably adding *.mode1v3 and *.pbxuser files and now the .xcodeproj structure has changed so you need to modify your source control ignore files to include these new files. This simple how-to will use Git as an example but the logic applies to almost any other version control system.<br />
XCode 4 project file now stores a special folder called &#8220;xcuserdata&#8221; amongst other folders (&#8220;xcshareddata&#8221; to name one). While xcuserdata contains user specific files that you probably want to ignore, xcshareddata contains project settings that are project specific and does not relate to users so it&#8217;s a good idea to keep that one. If you decide to delete that one, the worst thing that will happen is that you will need to recreate your project schemes. So, to keep your current build schemes pay attention to the order of the things I&#8217;m going to do.</p>
<h3>Make your schemes &#8220;shared&#8221;</h3>
<p><span style="font-weight: normal; font-size: 13px;">If you don&#8217;t want to lose your schemes, first you need to make them shared so you can safely ignore/delete your personal settings. To do this, go to Editor-&gt;Edit Schemes&#8230; and from the opened dialog choose &#8220;Manage Schemes&#8221;. &gt;</span></p>
<div id="attachment_532" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.dizzey.com/wp-content/uploads/2011/04/Screen-shot-2011-04-19-at-17.44.05.png"><img class="size-medium wp-image-532" title="Edit Schemes" src="http://www.dizzey.com/wp-content/uploads/2011/04/Screen-shot-2011-04-19-at-17.44.05-300x205.png" alt="XCode Edit schemes" width="300" height="205" /></a><p class="wp-caption-text">Edit Schemes</p></div>
<p>&nbsp;</p>
<div id="attachment_533" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.dizzey.com/wp-content/uploads/2011/04/Screen-shot-2011-04-19-at-17.44.12.png"><img class="size-medium wp-image-533" title="Shared Scheme" src="http://www.dizzey.com/wp-content/uploads/2011/04/Screen-shot-2011-04-19-at-17.44.12-300x238.png" alt="Shared Scheme" width="300" height="238" /></a><p class="wp-caption-text">Shared Scheme</p></div>
<h3>Add user specific filename patterns to ignore files</h3>
<p>Now you can ignore all those files. To do this, you simply add patterns to the .gitignore file (or your vcs of choice alternative). With Git we can do this:</p>

<div class="wp_codebox"><table><tr id="p53026"><td class="code" id="p530code26"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000; font-weight: bold;">*</span>.mode1v3 <span style="color: #000000; font-weight: bold;">&gt;</span> .gitignore
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000; font-weight: bold;">*</span>.pbxuser <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> .gitignore
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000; font-weight: bold;">*</span>.xcuserdata <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> .gitignore
<span style="color: #7a0874; font-weight: bold;">echo</span> .DS_store <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> .gitignore</pre></td></tr></table></div>

<p lang="bash">The first two are XCode 3 specific so if you don&#8217;t plan on using it &#8211; you can ignore these 2. The next file is XCode 4 specific and lastly I added OSX noise files as well. And that&#8217;s about it for this simple post, hope someone finds it useful.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/ocaw5rvTikpUmHKWEQbMUBZpjQE/0/da"><img src="http://feedads.g.doubleclick.net/~a/ocaw5rvTikpUmHKWEQbMUBZpjQE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/ocaw5rvTikpUmHKWEQbMUBZpjQE/1/da"><img src="http://feedads.g.doubleclick.net/~a/ocaw5rvTikpUmHKWEQbMUBZpjQE/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/dizzey/~4/M7yJB6kMeGM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dizzey.com/development/cleaning-up-xcode-4-user-data-from-vcs-git/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.dizzey.com/development/cleaning-up-xcode-4-user-data-from-vcs-git/</feedburner:origLink></item>
		<item>
		<title>Looking for a partner to promote a math iPhone game</title>
		<link>http://feedproxy.google.com/~r/dizzey/~3/dsLIedj-JAU/</link>
		<comments>http://www.dizzey.com/news/looking-for-a-partner-to-promote-a-math-iphone-game/#comments</comments>
		<pubDate>Thu, 14 Apr 2011 14:52:24 +0000</pubDate>
		<dc:creator>Ivan</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[marketing]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[partnership]]></category>
		<category><![CDATA[promotion]]></category>

		<guid isPermaLink="false">http://www.dizzey.com/?p=525</guid>
		<description><![CDATA[Having lots of other projects gives me really little time to work on some of my own projects, specially when it comes to promoting already built apps. Thus I decided to partner up with someone to help promote an existing &#8230; <a href="http://www.dizzey.com/news/looking-for-a-partner-to-promote-a-math-iphone-game/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Having lots of other projects gives me really little time to work on some of my own projects, specially when it comes to promoting already built apps. Thus I decided to partner up with someone to help promote an existing iPhone game. The project is really interesting and fun, so far we have 100% positive responses but the game just won&#8217;t take off without help which I don&#8217;t have time to do.</p>
<p>So, if you&#8217;re good in promoting iOS games, drop me a note and I&#8217;ll provide more details.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/tLI_KzsYlVNCh7kbhJtgJCJMUrg/0/da"><img src="http://feedads.g.doubleclick.net/~a/tLI_KzsYlVNCh7kbhJtgJCJMUrg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/tLI_KzsYlVNCh7kbhJtgJCJMUrg/1/da"><img src="http://feedads.g.doubleclick.net/~a/tLI_KzsYlVNCh7kbhJtgJCJMUrg/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/dizzey/~4/dsLIedj-JAU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dizzey.com/news/looking-for-a-partner-to-promote-a-math-iphone-game/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.dizzey.com/news/looking-for-a-partner-to-promote-a-math-iphone-game/</feedburner:origLink></item>
		<item>
		<title>How to use Dropbox as a Git repository</title>
		<link>http://feedproxy.google.com/~r/dizzey/~3/pxiJaC-QCqY/</link>
		<comments>http://www.dizzey.com/development/how-to-use-dropbox-as-a-git-repository/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 18:03:55 +0000</pubDate>
		<dc:creator>Ivan</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[version control]]></category>

		<guid isPermaLink="false">http://www.dizzey.com/?p=513</guid>
		<description><![CDATA[We all know the Git is a very powerful distributed source control system and it&#8217;s a pleasure to use it. I sometimes have the need to work on some projects locally only (no servers, no collaborators, nothing too funky) so &#8230; <a href="http://www.dizzey.com/development/how-to-use-dropbox-as-a-git-repository/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We all know the Git is a very powerful distributed source control system and it&#8217;s a pleasure to use it. I sometimes have the need to work on some projects locally only (no servers, no collaborators, nothing too funky) so in order to keep track of my code changes I was using a local git repo which works just flawless. But having multiple computers this sometimes can be a pain, so you need to copy the latest version around which is not so cool. Dropbox (or any similar cloud solution) comes to the rescue. I&#8217;ll show you how easy it is to have Dropbox act as a Git server making it your personal code repo sync point.</p>
<p>First we need to create a bare git repo inside your Dropbox folder. I have created a subdirectory specially for my git repos named, well, &#8220;git&#8221; <img src='http://www.dizzey.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<div class="wp_codebox"><table><tr id="p51329"><td class="code" id="p513code29"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">$cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>Dropbox<span style="color: #000000; font-weight: bold;">/</span>Git
<span style="color: #007800;">$mkdir</span> Example.git
<span style="color: #007800;">$cd</span> Example.git
<span style="color: #007800;">$git</span> init <span style="color: #660033;">--bare</span></pre></td></tr></table></div>

<p>And the first part is finished. We now have a &#8220;remote&#8221; bare git repo ready to be cloned locally.</p>

<div class="wp_codebox"><table><tr id="p51330"><td class="code" id="p513code30"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">$cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>Projects
<span style="color: #007800;">$git</span> clone ~<span style="color: #000000; font-weight: bold;">/</span>Dropbox<span style="color: #000000; font-weight: bold;">/</span>Git<span style="color: #000000; font-weight: bold;">/</span>Example.git</pre></td></tr></table></div>

<p>And you&#8217;re done. Your local git is ready for the initial commit and when you want to sync the repo, you just do a &#8220;git push&#8221; as you&#8217;d normally do. All other computers are now able to pull the changes so you can work on multiple machines without a hassle.</p>
<h3>Warning</h3>
<p>Everything is not so pink, though. You need to be extra careful when pushing the changes. I&#8217;m using this approach on my own, so no collaborators. If you plan to have multiple people pushing to the repo at the same time (or you are pushing from multiple computers, in some crazy scenario) Dropbox might mix your changes and you can end up with the garbage data in the git repo. So, I guess this is really useful for 1 person only or for a really, really careful team of people.</p>
<p>There are also some discussions that are advising against this saying that the Dropbox can make a mess out of your git data. I haven&#8217;t heard of any case where this did happen but keep this in mind for sensitive projects. Also, feel free to let me know if anyone runs into issues.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/n3DRjsNJqPvO0HZIYS5rLm2LWdM/0/da"><img src="http://feedads.g.doubleclick.net/~a/n3DRjsNJqPvO0HZIYS5rLm2LWdM/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/n3DRjsNJqPvO0HZIYS5rLm2LWdM/1/da"><img src="http://feedads.g.doubleclick.net/~a/n3DRjsNJqPvO0HZIYS5rLm2LWdM/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/dizzey/~4/pxiJaC-QCqY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dizzey.com/development/how-to-use-dropbox-as-a-git-repository/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.dizzey.com/development/how-to-use-dropbox-as-a-git-repository/</feedburner:origLink></item>
		<item>
		<title>RESTful web service, API with ASP MVC 2</title>
		<link>http://feedproxy.google.com/~r/dizzey/~3/-n9x16tXqvA/</link>
		<comments>http://www.dizzey.com/development/net/restful-web-service-api-with-asp-mvc-2/#comments</comments>
		<pubDate>Thu, 07 Apr 2011 17:20:23 +0000</pubDate>
		<dc:creator>Ivan</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[webservice]]></category>

		<guid isPermaLink="false">http://www.dizzey.com/?p=486</guid>
		<description><![CDATA[In this very simple tutorial, I&#8217;ll show how to build a basic RESTful API with Microsoft ASP MVC 2 later to be used with various clients (e.g. iOS application). This is a very basic level tutorial but it will show &#8230; <a href="http://www.dizzey.com/development/net/restful-web-service-api-with-asp-mvc-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In this very simple tutorial, I&#8217;ll show how to build a basic RESTful API with Microsoft ASP MVC 2 later to be used with various clients (e.g. iOS application). This is a very basic level tutorial but it will show how easy it is to build powerful REST services in the matter of minutes.</p>
<p>The first thing to do is to create a new MVC 2 project, as simple as shown on the screenshot.</p>
<div id="attachment_489" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.dizzey.com/wp-content/uploads/2011/04/MVC2.jpg"><img class="size-medium wp-image-489" title="Create new MVC 2 project" src="http://www.dizzey.com/wp-content/uploads/2011/04/MVC2-300x232.jpg" alt="Create new MVC 2 project" width="300" height="232" /></a><p class="wp-caption-text">Create new MVC 2 project</p></div>
<p>Now, I have deleted the Account controller and all the views cause I don&#8217;t need it for this example, but you don&#8217;t have to. The key concept to understand here is pretty simple &#8211; instead of returning back the Views as action results, we return JSON. MVC already provides HTTP verbs such as GET, POST, PUT and DELETE so all we really need to do is prepare our data and (de)encode it as JSON and we&#8217;re done. Fortunately enough, MVC also provides built-in JsonResult which inherits ActionResult which makes our job even easier. A simple GET action that returns a &#8220;Hello World&#8221; might look like this:</p>

<div class="wp_codebox"><table><tr id="p48635"><td class="code" id="p486code35"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&#91;</span>HttpGet<span style="color: #008000;">&#93;</span>
<span style="color: #0600FF; font-weight: bold;">public</span> ActionResult Index<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #0600FF; font-weight: bold;">return</span> Json<span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Hello World!&quot;</span>, JsonRequestBehavior<span style="color: #008000;">.</span><span style="color: #0000FF;">AllowGet</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>There you go, a simple GET method is created. Now if you want to return something more complex, you can pass any serializable object to the Json() method and return that back. Here&#8217;s an array/dictionary combination.</p>

<div class="wp_codebox"><table><tr id="p48636"><td class="code" id="p486code36"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&#91;</span>HttpGet<span style="color: #008000;">&#93;</span>
<span style="color: #0600FF; font-weight: bold;">public</span> ActionResult Array<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	List<span style="color: #008000;">&amp;</span>lt<span style="color: #008000;">;</span>object<span style="color: #008000;">&amp;</span>gt<span style="color: #008000;">;</span> objects <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> List<span style="color: #008000;">&amp;</span>lt<span style="color: #008000;">;</span>object<span style="color: #008000;">&amp;</span>gt<span style="color: #008000;">;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>						
	Dictionary dict <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Dictionary<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
	dict<span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;key1&quot;</span>, <span style="color: #666666;">&quot;value1&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
	dict<span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;key2&quot;</span>, <span style="color: #666666;">&quot;value2&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
	objects<span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;item1&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
	objects<span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;item2&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
	objects<span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span>dict<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
	<span style="color: #0600FF; font-weight: bold;">return</span> Json<span style="color: #008000;">&#40;</span>objects, JsonRequestBehavior<span style="color: #008000;">.</span><span style="color: #0000FF;">AllowGet</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>This produces a JSON like this:</p>

<div class="wp_codebox"><table><tr id="p48637"><td class="code" id="p486code37"><pre class="json" style="font-family:monospace;">[&quot;item1&quot;,&quot;item2&quot;,{&quot;key1&quot;:&quot;value1&quot;,&quot;key2&quot;:&quot;value2&quot;}]</pre></td></tr></table></div>

<p>Ok, so how about other REST concepts like PUT, POST or DELETE? Easy as well. Define your action and just place a HTTP verb attribute like this example:</p>

<div class="wp_codebox"><table><tr id="p48638"><td class="code" id="p486code38"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&#91;</span>HttpPut<span style="color: #008000;">&#93;</span>
<span style="color: #008000;">&#91;</span>ActionName<span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Index&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span>
<span style="color: #0600FF; font-weight: bold;">public</span> ActionResult IndexPut<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span> key, <span style="color: #6666cc; font-weight: bold;">string</span> value<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	Dictionary dict <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Dictionary<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
	<span style="color: #000000;">System.<span style="color: #0000FF;">Web</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Caching</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">Cache</span> c <span style="color: #008000;">=</span> HttpContext<span style="color: #008000;">.</span><span style="color: #0000FF;">Cache</span><span style="color: #008000;">;</span>
	<span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>key <span style="color: #008000;">==</span> <span style="color: #0600FF; font-weight: bold;">null</span> <span style="color: #008000;">||</span> value <span style="color: #008000;">==</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span>
	<span style="color: #008000;">&#123;</span>
		dict<span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;result&quot;</span>, <span style="color: #666666;">&quot;failed&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
		dict<span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;message&quot;</span>, <span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Format</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;No key or no value provided&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
	<span style="color: #008000;">&#125;</span>
	<span style="color: #0600FF; font-weight: bold;">else</span>
	<span style="color: #008000;">&#123;</span>
		<span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>c<span style="color: #008000;">.</span><span style="color: #0000FF;">Get</span><span style="color: #008000;">&#40;</span>key<span style="color: #008000;">&#41;</span> <span style="color: #008000;">==</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span>
		<span style="color: #008000;">&#123;</span>
			c<span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span>key, value, <span style="color: #0600FF; font-weight: bold;">null</span>, <span style="color: #000000;">System.<span style="color: #0000FF;">Web</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Caching</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">Cache</span><span style="color: #008000;">.</span><span style="color: #0000FF;">NoAbsoluteExpiration</span>, <span style="color: #000000;">System.<span style="color: #0000FF;">Web</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Caching</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">Cache</span><span style="color: #008000;">.</span><span style="color: #0000FF;">NoSlidingExpiration</span>, <span style="color: #000000;">System.<span style="color: #0000FF;">Web</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Caching</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">CacheItemPriority</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Normal</span>, <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
			dict<span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;result&quot;</span>, <span style="color: #666666;">&quot;ok&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
			dict<span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;message&quot;</span>, <span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Format</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;You have inserted {0} for key {1}&quot;</span>, c<span style="color: #008000;">&#91;</span>key<span style="color: #008000;">&#93;</span>, key<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
		<span style="color: #008000;">&#125;</span>
		<span style="color: #0600FF; font-weight: bold;">else</span>
		<span style="color: #008000;">&#123;</span>
			dict<span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;result&quot;</span>, <span style="color: #666666;">&quot;failed&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
			dict<span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;message&quot;</span>, <span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Format</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Value for key {0} already exists. Use POST to modify the value&quot;</span>, key<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
		<span style="color: #008000;">&#125;</span>
	<span style="color: #008000;">&#125;</span>
	<span style="color: #0600FF; font-weight: bold;">return</span> Json<span style="color: #008000;">&#40;</span>dict<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p lang="csharp">The example above takes 2 input parameters named key and value (both strings but can be any object) and puts them into HTTP Cache. It also prevents to PUT another value with the same key. The project source code has other methods as well (POST and DELETE) used to modify the values and delete values for keys. Take a look on how that is implemented. This is very basic stuff so I won&#8217;t cover those methods here but feel free to ask in comments if something is unclear.</p>
<p lang="csharp">This REST example will be used for future posts covering REST integration in iOS, so you can keep it somewhere for testing. The project source code can be downloaded here: <a rel="attachment wp-att-496" href="http://www.dizzey.com/development/net/restful-web-service-api-with-asp-mvc-2/attachment/restservice/">ASP MVC 2 REST service example</a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/LR2SnlVY7Lj38abmtDdogZh7jqM/0/da"><img src="http://feedads.g.doubleclick.net/~a/LR2SnlVY7Lj38abmtDdogZh7jqM/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/LR2SnlVY7Lj38abmtDdogZh7jqM/1/da"><img src="http://feedads.g.doubleclick.net/~a/LR2SnlVY7Lj38abmtDdogZh7jqM/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/dizzey/~4/-n9x16tXqvA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dizzey.com/development/net/restful-web-service-api-with-asp-mvc-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.dizzey.com/development/net/restful-web-service-api-with-asp-mvc-2/</feedburner:origLink></item>
		<item>
		<title>One post a day at Dizzey.com. Promise.</title>
		<link>http://feedproxy.google.com/~r/dizzey/~3/vmruJRQRHdI/</link>
		<comments>http://www.dizzey.com/news/one-post-a-day-at-dizzey-com-promise/#comments</comments>
		<pubDate>Fri, 01 Apr 2011 19:31:21 +0000</pubDate>
		<dc:creator>Ivan</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[funny]]></category>
		<category><![CDATA[jokes]]></category>
		<category><![CDATA[news]]></category>

		<guid isPermaLink="false">http://www.dizzey.com/?p=484</guid>
		<description><![CDATA[Hello everyone! I&#8217;ve decided to do at least one post a day on Dizzey.com. That&#8217;s a promise! It&#8217;s what&#8217;s going to happen! So stay tuned for great new posts here in the future! Enjoy April the 1st! &#160; PS: In &#8230; <a href="http://www.dizzey.com/news/one-post-a-day-at-dizzey-com-promise/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Hello everyone!</p>
<p>I&#8217;ve decided to do at least one post a day on Dizzey.com. That&#8217;s a promise! It&#8217;s what&#8217;s going to happen! So stay tuned for great new posts here in the future!</p>
<p>Enjoy April the 1st!</p>
<p>&nbsp;</p>
<p>PS: In all seriousness, I&#8217;m planning to cover a bit bigger topic about RESTful webservices and their integration with iOS. I developed a small RESTful framework to help me with some projects that I decided to post on GitHub as an open source project so you can enjoy and use it as well. It&#8217;s based on simplicity and communicating with the services in 1-2 lines of code. Stay tuned!</p>

<p><a href="http://feedads.g.doubleclick.net/~a/cLILiAdstIpxWk6aOndaaPycKH8/0/da"><img src="http://feedads.g.doubleclick.net/~a/cLILiAdstIpxWk6aOndaaPycKH8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/cLILiAdstIpxWk6aOndaaPycKH8/1/da"><img src="http://feedads.g.doubleclick.net/~a/cLILiAdstIpxWk6aOndaaPycKH8/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/dizzey/~4/vmruJRQRHdI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dizzey.com/news/one-post-a-day-at-dizzey-com-promise/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.dizzey.com/news/one-post-a-day-at-dizzey-com-promise/</feedburner:origLink></item>
		<item>
		<title>Some XCode 4 tips</title>
		<link>http://feedproxy.google.com/~r/dizzey/~3/dii6qV32sac/</link>
		<comments>http://www.dizzey.com/development/should-i-switch-to-xcode-4/#comments</comments>
		<pubDate>Fri, 18 Mar 2011 20:30:47 +0000</pubDate>
		<dc:creator>Ivan</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[cocoa-touch]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://www.dizzey.com/?p=474</guid>
		<description><![CDATA[Apple kind of surprised me with releasing the XCode 4 along with the iOS 4.3. Honestly, I wasn’t expecting it until later this year or at least until iOS 5 was announced. But I’m glad it’s out, of course, and &#8230; <a href="http://www.dizzey.com/development/should-i-switch-to-xcode-4/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Apple kind of surprised me with releasing the XCode 4 along with the iOS 4.3. Honestly, I wasn’t expecting it until later this year or at least until iOS 5 was announced. But I’m glad it’s out, of course, and I already switched to using it vs XCode 3. I held back from trying out the beta versions so the experience was really exciting to me when I first tried it. Completely different experience compared to version 3.x and finally a single, fullscreen window. Pretty cool.</p>
<p>Anyway, I’m not going to review it as there are lots of reviews, I’m just going to point out a few things that I ran into while testing the last few days.</p>
<h2>How to enable LLVM in XCode 4</h2>
<p>By default, XCode uses a GCC kind of wrapper for LLVM so you&#8217;ll probably want to enable LLVM compiler and you can do that easily enough in build settings like so.</p>
<p><a href="http://www.dizzey.com/wp-content/uploads/2011/03/Screen-shot-2011-03-18-at-21.06.16.png"><img class="aligncenter size-medium wp-image-475" title="LLVM Compiler Enable" src="http://www.dizzey.com/wp-content/uploads/2011/03/Screen-shot-2011-03-18-at-21.06.16-300x213.png" alt="" width="300" height="213" /></a></p>
<p>Now that you enabled that naturally you want to enable LLDB too. LLDB is a debugger, it&#8217;s to LLVM what GDB is to GCC. To enable LLDB you need to choose &#8220;Edit Scheme&#8221; from the &#8220;Product&#8221; menu and for the &#8220;Run&#8221; phase you&#8217;ll see a debugger chooser dropdown. However, at this point for iOS projects you&#8217;re stuck with GDB as the LLDB is only available for Mac apps and not available for iOS, yet.</p>
<h2>How do I add existing frameworks to the XCode 4 projects?</h2>
<p>&#8220;Add the existing framework&#8230;&#8221; right click menu option is gone. So how do you add existing frameworks?! The option is there of course, it&#8217;s just a bit hidden. The trick is to open target settings and navigate to the &#8220;Build Phases&#8221; tab. There&#8217;s a section that says &#8220;Link binary with Libraries&#8221; and that&#8217;s our X. See below.</p>
<div id="attachment_476" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.dizzey.com/wp-content/uploads/2011/03/Screen-shot-2011-03-18-at-21.04.01.png"><img class="size-medium wp-image-476" title="Add existing frameworks" src="http://www.dizzey.com/wp-content/uploads/2011/03/Screen-shot-2011-03-18-at-21.04.01-300x222.png" alt="Add existing frameworks" width="300" height="222" /></a><p class="wp-caption-text">Add existing frameworks</p></div>
<h2>So, should I switch to XCode 4?</h2>
<p>Yup. I was in doubt and thought it might be a good idea to hold off of it for a while, at least until the next version but I tried it and found nothing that stops me from using it. In fact, I&#8217;m so pleased I&#8217;m having a hard time coding some legacy projects in XCode 3. I would suggest, though, to keep the version 3.x and install XCode 4 in a separate directory just in case&#8230;</p>
<p><strong>UPDATE:</strong></p>
<h4>Where do I set NSZombieEnabled?</h4>
<p>Got another tip here, it&#8217;s moved to a different place now. You need to choose &#8220;Edit Scheme&#8221; from the &#8220;Product&#8221; menu and you&#8217;ll find it there.</p>
<div id="attachment_480" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.dizzey.com/wp-content/uploads/2011/03/Screen-shot-2011-03-19-at-19.16.08.png"><img class="size-medium wp-image-480" title="Edit Scheme Xcode 4" src="http://www.dizzey.com/wp-content/uploads/2011/03/Screen-shot-2011-03-19-at-19.16.08-300x205.png" alt="Edit Scheme Xcode 4" width="300" height="205" /></a><p class="wp-caption-text">Edit Scheme Xcode 4</p></div>

<p><a href="http://feedads.g.doubleclick.net/~a/OUieQ-5rJqknhKzJUTjpJ-iJ-Zo/0/da"><img src="http://feedads.g.doubleclick.net/~a/OUieQ-5rJqknhKzJUTjpJ-iJ-Zo/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/OUieQ-5rJqknhKzJUTjpJ-iJ-Zo/1/da"><img src="http://feedads.g.doubleclick.net/~a/OUieQ-5rJqknhKzJUTjpJ-iJ-Zo/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/dizzey/~4/dii6qV32sac" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.dizzey.com/development/should-i-switch-to-xcode-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.dizzey.com/development/should-i-switch-to-xcode-4/</feedburner:origLink></item>
	</channel>
</rss>

