<?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/"
	>

<channel>
	<title></title>
	<atom:link href="http://blog.nextive.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.nextive.com</link>
	<description>Nextive Home Page</description>
	<pubDate>Thu, 03 Nov 2011 18:22:37 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>WEBINAR: It’s All About the Experience: Raising the Bar in Mobile Dev</title>
		<link>http://blog.nextive.com/519-webinar-it%e2%80%99s-all-about-the-experience-raising-the-bar-in-mobile-dev/</link>
		<comments>http://blog.nextive.com/519-webinar-it%e2%80%99s-all-about-the-experience-raising-the-bar-in-mobile-dev/#comments</comments>
		<pubDate>Thu, 03 Nov 2011 18:22:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.nextive.com/?p=519</guid>
		<description><![CDATA[Tuesday, November 8, 2011
2-3 PM Eastern
Register Here
What really matters most when developing mobile applications in today&#8217;s consumer driven universe? Start with understanding and embracing both the constraints and capabilities of the mobile platforms. Make sure the mobile app strives to create a delightful user experience. And, finally, be certain, the mobile app is built first [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Tuesday, November 8, 2011<br />
2-3 PM Eastern</strong></p>
<p><a href="http://www.csvep.com/registration/view.php?id=260#register">Register Here</a></p>
<p>What really matters most when developing mobile applications in today&#8217;s consumer driven universe? Start with understanding and embracing both the constraints and capabilities of the mobile platforms. Make sure the mobile app strives to create a delightful user experience. And, finally, be certain, the mobile app is built first for mobile and not for web.</p>
<p>Putting strong focus on the end-user experience is one of the key pillars of the approach used by Buenos-Aires based Globant. The firm has dedicated itself to blending stylistic product design, a healthy dose of next-gen development practices and a savvy awareness of client requirements to produce mind-blowing mobile solutions for clients around the world.</p>
<p>So how does Globant do it and how do these rarified applications really perform?</p>
<p>Our program will examine key use cases and also explore the impact of Globant’s recent acquisition of mobility trailblazer Nextive. We will dedicate some time also to reveal the inner workings of the Globant mobile ‘studio’ where developers regularly participate in the application definition process given their mobile and social expertise in UX and functionality.</p>
<p>Featured Speakers:</p>
<ul>
<li><strong>Guillermo Bodnar</strong>, CTO - North America, Globant</li>
<li><strong>Andrew Burgert</strong>, GM, Globant Mobile Studio</li>
<li><strong>John Barrera</strong>, Director, Product Management, Aeria Games</li>
<li><strong>Porter Felton</strong>, Executive Producer, Globant Mobile Studio</li>
<li><strong>Kirk Laughlin</strong>, Founder/ Editorial Director, Nearshore America</li>
</ul>
<p><a href="http://www.csvep.com/registration/view.php?id=260#register">Register Here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nextive.com/519-webinar-it%e2%80%99s-all-about-the-experience-raising-the-bar-in-mobile-dev/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Argentine President, Cristina Fernández de Kirchner, visits Globant&#8217;s new offices in &#8216;Laminar&#8217; building</title>
		<link>http://blog.nextive.com/510-argentine-president-cristina-fernandez-de-kirchner-visits-globants-new-building-laminar/</link>
		<comments>http://blog.nextive.com/510-argentine-president-cristina-fernandez-de-kirchner-visits-globants-new-building-laminar/#comments</comments>
		<pubDate>Fri, 09 Sep 2011 13:03:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.nextive.com/?p=510</guid>
		<description><![CDATA[
On September 8th, at 4:30 PM, Argentina&#8217;s President, Cristina Fernández de Kirchner, visited Globant&#8217;s new offices at &#8220;Laminar&#8221; building in Down-Town Buenos Aires.
She walked around the offices, meeting Globant&#8217;s co-founders and employees, and asked about projects that were being worked on. Although not much of a computer fan, she said she was a fan of [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.nextive.com/wp-content/uploads/2011/09/cristina.jpg" alt="cristina" title="cristina" width="640" height="451" class="aligncenter size-full wp-image-511" /></p>
<p>On September 8th, at 4:30 PM, Argentina&#8217;s President, Cristina Fernández de Kirchner, visited Globant&#8217;s new offices at &#8220;Laminar&#8221; building in Down-Town Buenos Aires.</p>
<p>She walked around the offices, meeting Globant&#8217;s co-founders and employees, and asked about projects that were being worked on. Although not much of a computer fan, she said she was a fan of companies like Globant.</p>
<p>She even posed for a picture in a meeting room full of colorful balls with Globant&#8217;s co-founders, Martín Migoya, Guibert Englebienne, Martín Umaran y Néstor Nocetti.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nextive.com/510-argentine-president-cristina-fernandez-de-kirchner-visits-globants-new-building-laminar/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Globant acquires Nextive</title>
		<link>http://blog.nextive.com/470-globant-acquires-nextive/</link>
		<comments>http://blog.nextive.com/470-globant-acquires-nextive/#comments</comments>
		<pubDate>Mon, 08 Aug 2011 21:53:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://blog.nextive.com/?p=470</guid>
		<description><![CDATA[San Francisco, California, August 2nd, 2011 - Globant, leader in the creation of innovative software products that appeal to global audiences, acquired Nextive, expanding Globant’s presence in the US, widening its expertise in mobile and social technologies and strengthening its position as leader in the creation of innovative software products.
With this acquisition, Globant plans to [...]]]></description>
			<content:encoded><![CDATA[<p><strong>San Francisco, California, August 2nd, 2011 -</strong> <a href="http://www.globant.com">Globant</a>, leader in the creation of innovative software products that appeal to global audiences, acquired Nextive, expanding Globant’s presence in the US, widening its expertise in mobile and social technologies and strengthening its position as leader in the creation of innovative software products.</p>
<p>With this acquisition, Globant plans to expand its portfolio of mobile and social services through Nextive&#8217;s capabilities. Founded in 2008 in San Francisco, California, Nextive has a broad set of clients in the US, including companies like Crowdstar, GSN and Zynga. Nextive&#8217;s team will lead <a href="http://www.globant.com/Content/Studios/Mobile/">Globant ́s Mobile Studio</a>, adding new practices and increasing its reach. Nextive&#8217;s more than 130 professionals will join Globant&#8217;s team, working from their development centers in San Francisco, Buenos Aires and Cordoba.</p>
<p>Nextive&#8217;s US headquarters will allow Globant to strengthen its presence near its customers and propel its growth in North America. After this transaction, Globant plans to expand the US team. The Company is currently hiring 120 new Globers per month worldwide, and expects to add 200 US-based professionals in the next two years as well.</p>
<p>“We are really excited about this deal. We are glad Nextive is joining us because it will allow us to keep growing in the US. Since we founded Globant, we wanted to create a company that brought opportunities for talent worldwide, so with this acquisition, we will be creating job opportunities for US professionals”, commented Martin Migoya, Globant CEO &#038; Co-founder. He added: “For us it ́s key to continue working on the specialized expertise we have built with our Studios. Nextive strongly complements our knowledge in mobile innovative solutions, which will benefit our customers.”</p>
<p>“Nextive and Globant share the same culture of innovation and challenge. Globant ́s global vision, constant growth and creativity, combined with the experience and talent of both companies, will allow us to augment our services and relationships with customers,” pointed out Martin Umaran, Globant COO, M&#038;A chief &#038; Co-founder.</p>
<p>“We are excited to join the ever-growing Globant team in the US and Argentina, where we will find plenty of challenges and new opportunities with companies like EA, Linkedin and Google. We will also be able to realize the full potential of our combined efforts to produce outstanding mobile and social experiences for larger audiences”, stated Andrew Burgert, Nextive CEO.</p>
<p><strong>About Globant</strong><br />
Globant is the Latin American leader in the creation of innovative software products that appeal to global audiences, specializing in the use of agile methodologies and a rational blend of open source and proprietary software. At Globant we have a holistic view of software development, where the best engineers team up with art design studios and innovation labs to deliver a superb user experience. Globant is a privately held, privately funded company headquartered in Buenos Aires, Argentina with offices in Tandil, Cordoba, Rosario, Resistencia, Bahia Blanca and La Plata in Argentina, San Francisco, New York and Boston in the United States, Montevideo, Bogota, and London. For more information, visit <a href="http://www.globant.com">www.globant.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nextive.com/470-globant-acquires-nextive/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Crash Course in CouchDB</title>
		<link>http://blog.nextive.com/426-crash-course-in-couchdb/</link>
		<comments>http://blog.nextive.com/426-crash-course-in-couchdb/#comments</comments>
		<pubDate>Mon, 01 Aug 2011 19:03:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://blog.nextive.com/?p=426</guid>
		<description><![CDATA[Since we are considering using CouchDB for data storage on our apps backend (and possibly on the frontend as well) I cooked this small intro.
Some facts about CouchDB that you should know:

CouchDB is a JSON document-oriented database written in Erlang.
It is a highly concurrent database designed to be easily replicable, horizontally, across numerous devices and [...]]]></description>
			<content:encoded><![CDATA[<div><span id="internal-source-marker_0.03192763892002404"><img class="alignright size-full wp-image-429" title="CouchDb" src="http://blog.nextive.com/wp-content/uploads/2011/08/01a.jpg" alt="CouchDb" width="219" height="315" />Since we are considering using <a href="http://couchdb.apache.org/">CouchDB </a>for data storage on our apps backend (and possibly on the frontend as well) I cooked this small intro.</span></p>
<p><span>Some facts about CouchDB that you should know:</span></p>
<ul>
<li><span>CouchDB is a JSON document-oriented database written in</span><a href="http://erlang.org/"><span> </span><span>Erlang</span></a><span>.</span></li>
<li><span>It is a highly concurrent database designed to be easily replicable, horizontally, across numerous devices and be fault tolerant.</span></li>
<li><span>It is an open source Apache foundation project.</span></li>
<li><span>It allows applications to store JSON documents via its RESTful interface.</span></li>
<li><span>It makes use of map/reduce to index and query the database.</span></li>
</ul>
</div>
<div>
<h2 dir="ltr"><span>Main Benefits of CouchDB</span></h2>
<ul>
<li><strong>JSON Documents</strong><span> – Everything stored in CouchDB boils down to a JSON document.</span></li>
<li><strong>RESTful Interface</strong><span> – From creation to replication to data insertion, every management and data task in CouchDB can be done via HTTP.</span></li>
<li><strong>N-Master Replication</strong><span> – You can make use of an unlimited amount of ‘masters’, making for some very interesting replication topologies.</span></li>
<li><strong>Built for Offline</strong><span><strong> </strong>– CouchDB can replicate to devices (like Android phones) that can go offline and handle data sync for you when the device is back online.</span></li>
<li><strong>Replication Filters</strong><span> – You can filter precisely the data you wish to replicate to different nodes.</span></li>
</ul>
</div>
<div>
<h2 dir="ltr"><span>Taking CouchDB out for a ride</span></h2>
<p><span>The easiest way to test CouchDB is to use one of the many services on the cloud, I’m assuming for the rest of the document that we use </span><a href="http://www.iriscouch.com"><span>http://www.iriscouch.com</span></a><span>, its free (for small users)  and takes seconds to set up.</span></p>
<h2 dir="ltr"><span>Feel the Futon</span></h2>
</div>
<div><span>After setting up your account, you should see the Futon control panel in your browser. If not, go to </span><a href="http://mysubdomain.iriscouch.com"><span>http://mysubdomain.iriscouch.com</span></a><span> (that would be the subdomain you just created).</span></div>
<div><span>Let’s create a database called mydb.</span></div>
<div><span><br />
</span></div>
<div><span><img class="aligncenter size-full wp-image-435" title="031" src="http://blog.nextive.com/wp-content/uploads/2011/08/031.png" alt="031" width="454" height="236" /><br />
</span></div>
<div><span></p>
<div>
<h2 id="internal-source-marker_0.6015123557299376" dir="ltr"><span>Users in CouchDB</span></h2>
<h2 id="internal-source-marker_0.6015123557299376" dir="ltr"><span><img class="alignright size-full wp-image-436" title="041" src="http://blog.nextive.com/wp-content/uploads/2011/08/041.png" alt="041" width="169" height="194" /></span></h2>
<p><span>Be advised! CouchDB, by default, is completely open, giving every user admin rights. This is great for development but obviously bad for production. In the bottom right, you will see “Welcome to Admin Party! Everyone is admin! Fix this”.</span><br />
<span>Go ahead and click </span><span>fix this</span><span> and give yourself a username and password. This creates an admin account and gives anonymous users access to read and write operations on all the databases, but no configuration privileges.</span><br />
<span>Users are just JSON documents like everything else so you can store any additional attributes you wish like email for example. You can then use groups within CouchDB to control what documents each user has write access to.</span><br />
<span> <span> </span><span> </span><span> </span></span></p>
<h2 dir="ltr"><span>Creating a Document</span></h2>
<p><span>Now we’re going to create our first document using Futon:</span></p>
<ol>
<li><span>Open the mydb database.</span></li>
<li><span>Click “New Document”.</span></li>
<li><span>Click “Add Field” to begin adding data to the document. Notice how an ID is completed out for you, you should not change this unless you know exactly what you´re doing (and the chances are that you don&#8217;t if you’re reading this). Add key “game” with the value of “Nextive CouchDB Tutorial”.</span></li>
<li><span>Make sure you click the green tick next to each attribute to save it.</span></li>
<li><span>Click “Save Document”.</span></li>
</ol>
</div>
<p><img class="aligncenter size-full wp-image-437" title="05" src="http://blog.nextive.com/wp-content/uploads/2011/08/05.png" alt="05" width="459" height="129" /></p>
<div>
<h2 id="internal-source-marker_0.9605554607696831" dir="ltr"><span>Updating a Document</span></h2>
<p><span>CouchDB is an append only database — that means that new updates are appended to the database and do not overwrite the old version. Each new update to a JSON document with a pre-existing ID will add a new revision. This is what the automatically inserted revision key signifies. Follow the steps below to see this in action:</span></p>
<ul>
<li><span>Viewing the contents of the mydb database, click the only record visible.</span></li>
<li><span>Add another attribute with the key “type” and the value “game”.</span></li>
<li><span>Hit “Save Document”.</span></li>
</ul>
</div>
<div><span>After saving, a new revision key should be visible starting with the number 2. Going back a level to the mydb database view, you will still see just one document, this is the latest revision of our game document.</span></div>
<div><span><img class="aligncenter size-full wp-image-439" title="06" src="http://blog.nextive.com/wp-content/uploads/2011/08/06.png" alt="06" width="462" height="131" /><br />
</span></div>
<div><span></p>
<div>
<h2 id="internal-source-marker_0.35745325358584523" dir="ltr"><span>Creating a Document Using cURL</span></h2>
<p><span>I mentioned earlier that CouchDB uses a RESTful interface, let’s prove this by inserting a document using cURL via the Terminal.</span><br />
<strong>First</strong><span>, let’s create a JSON document with the below contents and save it to the desktop calling the file person.json.</span></p>
<p><code><span>{ </span><br />
<span> &#8220;name&#8221;: &#8220;Bruce&#8221;, </span><br />
<span> &#8220;surname&#8221;:  &#8221;Wayne&#8221;, </span><br />
<span> &#8220;type&#8221;:     &#8221;person&#8221; </span><br />
<span>}</span></code></p>
<p><strong>Next</strong><span>, open the terminal in the Desktop then perform the insert with:</span><br />
<span>curl -X POST http://mysubdomain.iriscouch.com/mydb  -d @person.json -H &#8220;Content-Type: application/json&#8221;</span></p>
<p><span>CouchDB should have returned a JSON document similar to the one below.</span></p>
<p><span>{&#8221;ok&#8221;:true,&#8221;id&#8221;:&#8221;259191a3020fd260d1bb66cf17594757&#8243;,&#8221;rev&#8221;:&#8221;1-f62208cb5761dd5c7d1c5954dfba0e7a&#8221;}</span></p>
<p><span>This is the ID and revision number of the inserted document. </span></p>
<p><span>CouchDB follows the RESTful convention so:</span></p>
<ul>
<li><strong>POST</strong><span><strong> </strong>– creates a new record</span></li>
<li><strong>GET</strong><span> – reads records</span></li>
<li><strong>PUT</strong><span> – updates a record</span></li>
<li><strong>DELETE</strong><span> – deletes a record</span></li>
</ul>
<h2 dir="ltr"><span>Viewing All Documents</span></h2>
<p><span>We can further verify our insert by viewing all the documents in our mydb database by executing </span><span>curl -X GET http://mysubdomain.iriscouch.com/mydb/_all_docs</span></p>
<h2 dir="ltr"><span>Creating a Map Function</span></h2>
<p><span>Viewing all documents is nice, but fairly useless in itself. What if we only want to show all game documents?. Follow the steps below to produce the magic:</span></p>
<ul>
<li><span>Within Futon, click on the view drop down and select “Temporary View”.</span></li>
<li><span>This is the map reduce editor within Futon. Copy the code below into the map function.</span></li>
</ul>
<p><code><br />
</code></p>
<p><code></p>
<p dir="ltr"><span>function (doc) { </span></p>
<p dir="ltr"><span> if (doc.type === &#8220;game&#8221; &amp;&amp; doc.game) { </span></p>
<p dir="ltr"><span> emit(doc.game, doc); </span></p>
<p dir="ltr"><span> } </span></p>
<p dir="ltr"><span>} </span></p>
<p></code></p>
<ul>
<li><span>Click run and you should see (if you didn&#8217;t mess up)  the single game we added previously.</span></li>
<li><span>Go ahead and make this view permanent by saving it.</span></li>
</ul>
</div>
<div><img class="aligncenter size-full wp-image-440" title="071" src="http://blog.nextive.com/wp-content/uploads/2011/08/071.png" alt="071" width="470" height="182" /></div>
<div><span id="internal-source-marker_0.18421469978056848">After creating this simple map function, we can now request this view and see its contents over HTTP using the following command :</span><br />
<span>curl -X GET http://mysubdomain.iriscouch.com/mydb/_design/games/_view/games</span><br />
<span>Notice that we get the document’s ID and revision by default.</span></div>
<div>
<h2 dir="ltr"><span>Reduce Fat Fast</span></h2>
</div>
<div><span>To perform a useful reduce (on SQL we would call this aggregation), add another game to our database and add a users attribute with the value of 5000 to our first game.</span></div>
<div><span><img class="aligncenter size-full wp-image-441" title="08" src="http://blog.nextive.com/wp-content/uploads/2011/08/08.png" alt="08" width="464" height="150" /></span></div>
<div><span><img class="aligncenter size-full wp-image-442" title="09" src="http://blog.nextive.com/wp-content/uploads/2011/08/09.png" alt="09" width="464" height="149" /><br />
</span></div>
<div><span></p>
<div><span id="internal-source-marker_0.39581815828569233">For our new view, we will include a reduce in addition to a map. First, we need to create a map:</span></p>
<p><code><span> function (doc) { </span><br />
<span> <span> </span>if (doc.type === &#8220;game&#8221; &amp;&amp; doc.users) { </span><br />
<span> <span> </span>emit(doc.id, doc.users); </span><br />
<span> <span> </span>} </span><br />
<span>}</span></code></p>
<p><span>The above map function simply checks to see if the inputted document is a game and that it has users. If these conditions have been met, the game users is emitted. Next, the reduce function:</span></p>
<p><code><span>function (keys, users) { </span><br />
<span><span> </span>return sum(users); </span><br />
<span>} </span></code></p>
<p><span>It takes the users count and returns the sum using one of CouchDB’s built in reduce functions. Make sure you check the reduce option in the top right of the results table as you may otherwise be unable to see the results of the reduce. You need to save the view first to see the results of the reduce.</span></p>
<p><img class="aligncenter size-full wp-image-444" title="101" src="http://blog.nextive.com/wp-content/uploads/2011/08/101.png" alt="101" width="464" height="170" /></div>
<div><span></p>
<div>
<h2 id="internal-source-marker_0.8186871241778135" dir="ltr"><span>Conclusion</span></h2>
<p><span>In this article, we took a brief look at CouchDB, one of the more mature NoSQL database available today. Even the most fervent SQL believer can see the advantages that this type of database offers, especially for high demand write operations.</span></div>
<p></span></div>
<div><span><br />
</span></div>
<p></span></div>
<p></span></div>
<p></span></div>
<h5> Credits: Luciano Rubinsztejn</h5>
]]></content:encoded>
			<wfw:commentRss>http://blog.nextive.com/426-crash-course-in-couchdb/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Nextive participating in Bay Area Social Gaming on Android meetup on July 28th</title>
		<link>http://blog.nextive.com/421-nextive-participating-in-bay-area-social-gaming-on-android-meetup-on-july-28th/</link>
		<comments>http://blog.nextive.com/421-nextive-participating-in-bay-area-social-gaming-on-android-meetup-on-july-28th/#comments</comments>
		<pubDate>Tue, 26 Jul 2011 20:38:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Conferences & Events]]></category>

		<guid isPermaLink="false">http://blog.nextive.com/?p=421</guid>
		<description><![CDATA[Hernan Pelassini, Nextive&#8217;s CTO, will be participating in the &#8220;Do&#8217;s &#38; Don&#8217;ts of building a mobile game&#8221; meetup hosted by PapayaMobile this Thursday July 28th, 6:30-9:30pm, @pariSoma lofts. 169 11th St., San Francisco.
Topics will be the following:

Game Development: Why mobile? Where to start? Fragmentation in that market (as compared to iOS)? Virality - how do [...]]]></description>
			<content:encoded><![CDATA[<p>Hernan Pelassini, Nextive&#8217;s CTO, will be participating in the <a href="http://www.meetup.com/Bay-Area-Social-Gaming-on-Android/events/23721461/">&#8220;Do&#8217;s &amp; Don&#8217;ts of building a mobile game</a>&#8221; meetup hosted by PapayaMobile this Thursday July 28th, 6:30-9:30pm, @pariSoma lofts. 169 11th St., San Francisco.</p>
<p>Topics will be the following:</p>
<ol>
<li><strong>Game Development:</strong> Why mobile? Where to start? Fragmentation in that market (as compared to iOS)? Virality - how do we measure it?</li>
<li><strong>Marketing/Distribution:</strong> What do I do with my game after I&#8217;ve made it? Big Players can cross promote, what should/can the small players do? Where can I get the most exposure for my game?</li>
<li><strong>Monetization:</strong> Freemium vs paid models? iOS/Android? Where do I make more money? How do I make money? Which business models work? Which don&#8217;t work? What to integrate into my game?</li>
<li><strong>Learn from our mistakes:</strong> If I could rewind time, what would I do differently? What not to do? What failed? What didn&#8217;t work? Things to avoid - back to the future.</li>
</ol>
<p>Come join us for a night of drinks, learnings, questions, and networking fun! (and someone asking our panelists any scary/embarassing questions about building mobile games!)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nextive.com/421-nextive-participating-in-bay-area-social-gaming-on-android-meetup-on-july-28th/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Joel Koett is our iPad 2 winner!</title>
		<link>http://blog.nextive.com/405-joel-koett-is-our-ipad-2-winner/</link>
		<comments>http://blog.nextive.com/405-joel-koett-is-our-ipad-2-winner/#comments</comments>
		<pubDate>Fri, 22 Jul 2011 20:01:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Conferences & Events]]></category>

		<guid isPermaLink="false">http://blog.nextive.com/?p=405</guid>
		<description><![CDATA[We are very pleased to announce that Joel Koett, a software engineer from game developer Backstage, is the proud winner of draw we made for an iPad 2 at Casual Connect!
Congratulations Joel!

]]></description>
			<content:encoded><![CDATA[<p>We are very pleased to announce that Joel Koett, a software engineer from game developer <a href="http://www.bstage.ca/">Backstage</a>, is the proud winner of draw we made for an iPad 2 at <a href="http://seattle.casualconnect.org/">Casual Connect</a>!</p>
<p>Congratulations Joel!</p>
<p><img class="aligncenter size-full wp-image-408" title="joel" src="http://blog.nextive.com/wp-content/uploads/2011/07/joel.jpg" alt="joel" width="300" height="225" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nextive.com/405-joel-koett-is-our-ipad-2-winner/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Nextive JSON Parser for iOS and Mac OS – Fast</title>
		<link>http://blog.nextive.com/392-nextive-json-parser-for-ios-and-mac-os-%e2%80%93-fast/</link>
		<comments>http://blog.nextive.com/392-nextive-json-parser-for-ios-and-mac-os-%e2%80%93-fast/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 12:34:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[OS]]></category>

		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://blog.nextive.com/?p=392</guid>
		<description><![CDATA[Dear all,
The code with which the Nextive JSON Parser was tested on had a bug, which gave the results we published. After the bug was fixed, the resulting speed wasn&#8217;t as fast, although it&#8217;s still one of the fastest out there.
The parser, which works for iOS and Mac OS, still has a few things which [...]]]></description>
			<content:encoded><![CDATA[<p>Dear all,</p>
<p>The code with which the Nextive JSON Parser was tested on had a bug, which gave the results we published. After the bug was fixed, the resulting speed wasn&#8217;t as fast, although it&#8217;s still one of the fastest out there.</p>
<p>The parser, which works for iOS and Mac OS, still has a few things which can improve performance, and we&#8217;ll continue working on it until we max it out. In the meantime, we&#8217;ll keep posting screenshots with the latest results.</p>
<p><img src="http://blog.nextive.com/wp-content/uploads/2011/07/photo1.png" alt="photo1" title="photo1" width="180" height="270" class="aligncenter size-full wp-image-418" /></p>
<p>&#8212;&#8211;<br />
We released our Nextive JSON Parser for iOS and Mac OS on GitHub:<br />
<a href="https://github.com/nextive/NextiveJson">https://github.com/nextive/NextiveJson</a></p>
<p>We noticed it performs really well on iOS (images below) when parsing Twitter’s public timeline.  Please let us know if it makes a difference in your product!</p>
<table width="400" border="0" align="center" cellpadding="20" cellspacing="0">
<tr>
<td align="center" valign="top"><img src="http://blog.nextive.com/wp-content/uploads/2011/07/json-parser-1a.png" alt="json-parser-1a" title="json-parser-1a" width="180" height="270" class="aligncenter size-full wp-image-416" /></td>
<td align="center" valign="top"><img src="http://blog.nextive.com/wp-content/uploads/2011/07/json-parser-2a.png" alt="json-parser-2a" title="json-parser-2a" width="180" height="270" class="aligncenter size-full wp-image-417" /></td>
</tr>
</table>
<h5>Credits: Martin Adoue and Hernan Pelassini</h5>
]]></content:encoded>
			<wfw:commentRss>http://blog.nextive.com/392-nextive-json-parser-for-ios-and-mac-os-%e2%80%93-fast/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Nextive sponsoring Casual Connect, starting today!</title>
		<link>http://blog.nextive.com/384-nextive-sponsoring-casual-connect-starting-today/</link>
		<comments>http://blog.nextive.com/384-nextive-sponsoring-casual-connect-starting-today/#comments</comments>
		<pubDate>Tue, 19 Jul 2011 14:09:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Conferences & Events]]></category>

		<guid isPermaLink="false">http://blog.nextive.com/?p=384</guid>
		<description><![CDATA[Casual Connect is the place to learn more about an industry which entertains 300 million people each month. Learn all about iPhone, Social, Android, Flash, Browser MMO and Downloadable Games.&#160;

Nextive is sponsoring the event, attending the different tracks and meeting with companies and customers. If you&#8217;re nearby, make a stop at our booth. If you [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://seattle.casualconnect.org/">Casual Connect</a> is <em>the</em> place to learn more about an industry which entertains 300 million people each month. Learn all about iPhone, Social, Android, Flash, Browser MMO and Downloadable Games.<br />&nbsp;<br />
<img src="http://blog.nextive.com/wp-content/uploads/2011/07/casual_connect-690.jpg" alt="Casual Connect" title="Casual Connect" width="690" height="403" class="aligncenter size-full wp-image-385" /><br />
Nextive is sponsoring the event, attending the different tracks and meeting with companies and customers. If you&#8217;re nearby, make a stop at our booth. If you give us your card, you participate in a draw for an iPad 2!</p>
<p>Hope to see you there!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nextive.com/384-nextive-sponsoring-casual-connect-starting-today/feed/</wfw:commentRss>
		</item>
		<item>
		<title>New offices in Córdoba!</title>
		<link>http://blog.nextive.com/368-new-offices-in-cordoba/</link>
		<comments>http://blog.nextive.com/368-new-offices-in-cordoba/#comments</comments>
		<pubDate>Fri, 15 Jul 2011 21:00:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.nextive.com/?p=368</guid>
		<description><![CDATA[We continue to expand during 2011!
You can now find us at:
Arturo M. Bas 136, 5th Floor, Suite C, X5000KLD
Ciudad de Córdoba, Argentina
Phone: +54 (351) 598-7140
Map Link
A few pics of our offices:




]]></description>
			<content:encoded><![CDATA[<p>We continue to expand during 2011!</p>
<p>You can now find us at:</p>
<p><strong>Arturo M. Bas 136, 5th Floor, Suite C, X5000KLD<br />
Ciudad de Córdoba, Argentina</strong><br />
Phone: +54 (351) 598-7140<br />
<a href="http://maps.google.com/maps/place?cid=1513943993632105379&amp;q=nextive+cordoba&amp;hl=en&amp;sll=-31.41511,-64.192935&amp;sspn=0.071946,0.071946&amp;ie=UTF8&amp;ll=-31.3249,-64.329414&amp;spn=0,0&amp;z=12">Map Link</a></p>
<p>A few pics of our offices:</p>
<p><img class="aligncenter size-full wp-image-373" title="Nextive Cordoba 1" src="http://blog.nextive.com/wp-content/uploads/2011/07/p10100181.jpg" alt="Nextive Cordoba 1" width="500" height="375" /><br />
<img class="aligncenter size-full wp-image-374" title="p1010019" src="http://blog.nextive.com/wp-content/uploads/2011/07/p1010019.jpg" alt="p1010019" width="500" height="375" /><br />
<img class="aligncenter size-full wp-image-375" title="p1010001" src="http://blog.nextive.com/wp-content/uploads/2011/07/p1010001.jpg" alt="p1010001" width="500" height="375" /><br />
<img class="aligncenter size-full wp-image-376" title="p1010022" src="http://blog.nextive.com/wp-content/uploads/2011/07/p1010022.jpg" alt="p1010022" width="500" height="375" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nextive.com/368-new-offices-in-cordoba/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Core Data</title>
		<link>http://blog.nextive.com/310-core-data/</link>
		<comments>http://blog.nextive.com/310-core-data/#comments</comments>
		<pubDate>Tue, 05 Jul 2011 14:38:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://blog.nextive.com/?p=310</guid>
		<description><![CDATA[Core Data Introduction



Properties List / NSUserDefaults: We can easily persist a lot of common iOS data structures (like NSArray, NSDictionary, NSString, NSNumber, etc) in a plist file. Also we can persist custom objects through NSCoding protocol. The problem with this technique is when we handle big volumes of data, for example if we have 100 [...]]]></description>
			<content:encoded><![CDATA[<h3>Core Data Introduction</h3>
<div>
<div>
<ul id="internal-source-marker_0.9370252338703722">
<li><span>Properties List / NSUserDefaults: We can easily persist a lot of common iOS data structures (like NSArray, NSDictionary, NSString, NSNumber, etc) in a plist file. Also we can persist custom objects through NSCoding protocol. The problem with this technique is when we handle big volumes of data, for example if we have 100 records in a plist and we want to read one of those record, we have to load the 100 records in memory first. And if we want to add a record to that list or update some of them, we need to save all records in the plist. As we get more records in a plist we are going to make more unnecessary read/write operations and bad use of memory.</span></li>
</ul>
<ul>
<li><span>SQLite: This is more robust than the first option but is more complex to use. You can use sql syntax to get only the records that you want and update or add records without having to load all records in memory or write all records locally. The API to handle SQLite is a little complex and there isn’t an easy way to persist objects.</span></li>
</ul>
<ul>
<li><span>Core Data: What’s Core Data? Well, basically it’s an ORM (Object-relational mapping) that provides a high level of abstraction. It uses SQLite to persist the objects and it’s available on iOS 3.0 and higher. I think it has the best of the two previous options: it’s easy to use and it’s robust.</span></li>
</ul>
</div>
<h3>Core Data Stack:</h3>
<p>We are going to mention the most important classes in Core Data framework:</p>
<p><img class="aligncenter size-full wp-image-326" title="Core Data Framework" src="http://blog.nextive.com/wp-content/uploads/2011/07/image031.png" alt="Core Data Framework" width="500" height="352" /></p>
<p>&nbsp;</p>
<div>
<ul id="internal-source-marker_0.9370252338703722">
<li><strong>Managed Object (NSManagedObject)</strong><span>:</span><span> It represents one entity’s instance. If we have an entity called Employee, one managed object represents one employee.</span></li>
</ul>
<ul>
<li><strong>Managed Object Context (NSManagedObjectContext):</strong><span><strong> </strong>This is the context where the managed objects live.</span></li>
</ul>
<ul>
<li><strong>Manged Object Model (NSManagedObjectModel):</strong><span><strong> </strong>It represents the data model used to do the mapping between the classes and the relational model.</span></li>
</ul>
<ul>
<li><strong>Persistent Store Coordinator (NSPersistentStoreCoordinator):</strong><span><strong> </strong>This is a collection of Persistent Object Store classes.</span></li>
</ul>
<ul>
<li><span>Persistent Object Store (NSPersistentObjectStore):</span><span> It represents a storage (Core Data usually uses SQLite).</span></li>
</ul>
</div>
<h3>Using Core Data</h3>
<p>In order to start using Core Data in our project we have to do the following steps:</p>
<ol>
<li>Add the framework <strong>CoreData.framework</strong> to the project.</li>
<li>Create a <strong>Data Model </strong>with Xcode.</li>
<li>Generate the data classes (those classes are subclasses of NSManagedObject.</li>
<li>Create a <strong>Managed Object Model</strong> with the defined <strong>Data Model</strong>.</li>
<li>Create the <strong>Persistent Store Coordinator </strong>with the created <strong>Managed Object Model</strong> and set a <strong>Persistent Object Store</strong> on it.</li>
<li>Finally, create a <strong>Managed Object Context</strong> and set the created <strong>Persistent Store Coordinator</strong>.</li>
</ol>
</div>
<p>We are going to use the created <strong>Managed Object Context </strong>to do CRUD operations (create, read, update and delete).</p>
<p>In the next sections we are going to describe deeper the necessary steps to get a <strong>Managed Object Context</strong>.</p>
<h3>Creating a Data Model</h3>
<p>The Data Model represents the entities and relationships mainly. It helps to do the mapping of the objects to the persistent store. Those are the necessary steps to create a Data Model using Xcode ver 3.2.x:</p>
<p>Go to the option File &gt;&gt; New File in the menu, select the iOS / Resource group and choose the option Data Model.</p>
<p><img class="aligncenter size-full wp-image-327" title="Data Model" src="http://blog.nextive.com/wp-content/uploads/2011/07/image041.png" alt="Data Model" width="500" height="308" /></p>
<p>&nbsp;</p>
<p>If the project already has data classes we have an option to automatically generate the data model based on that classes. We just have to select which classes we want to add to the data model.</p>
<p><img class="aligncenter size-full wp-image-328" title="Data Model Classes" src="http://blog.nextive.com/wp-content/uploads/2011/07/image061.png" alt="Data Model Classes" width="500" height="349" /></p>
<p>&nbsp;</p>
<p>Finally, we are going to see the tool to create our Data Model. This tool is very straightforward to use. Graphically you can create or update you Data Model.</p>
<p><img class="aligncenter size-full wp-image-329" title="Data Model Tool" src="http://blog.nextive.com/wp-content/uploads/2011/07/image011.png" alt="Data Model Tool" width="650" height="541" /></p>
<p>&nbsp;</p>
<p>You can see that in the Data Model that we have two entities: Team and Match. Team has an attribute called name and it has two relationships with Match. Match represents a game between two teams. It has as attributes: the date of the match, the score of both teams and it has two relationships to the entity Team. We are going to use this data model to describe some CRUD operations.</p>
<p>Every entity can have:</p>
<ul>
<li>Attributes, similar to a field in a record, you can define the type, if it’s optional or not, if it’s indexed, etc.</li>
<li>Relationship with other Entities: the relationships can be 1 to 1, 1 to N.</li>
<li>Fetched Properties: It’s some kind of mix between relationships and fetches.</li>
</ul>
<h3>Generating Data Classes from the Data Model</h3>
<p>Now that we have a data model created, we can automatically create the data classes that represent the entities defined in the model. Every data class is going to represent an instance of one entity. The generated classes are subclasses of NSManagedObject class.</p>
<p>There are two tools to generate these data classes. One tool is integrated with Xcode and the other one it’s a third party tool called Mogenerator (http://rentzsch.github.com/mogenerator/), the main different with the Xcode tool classes is that Mogenerator creates two set of classes per entity: one for machines, one for humans. The machine class can be always be overwritten to match the data model, while the human class with humans’ work is preserved.</p>
<p>I’m going to describe the steps to generate the classes with Xcode ver 3.2.x:</p>
<p>First, We have to be in the Xcode Data Model tool and go to File &gt;&gt; New File in the menu and choose the group Cocoa Touch Class and select Managed Object Class. If we aren’t on the Data Model tool, we are not going to see the final Managed Object Class option.</p>
<p class="MsoNormal"><img class="aligncenter size-full wp-image-330" title="Managed Object Class" src="http://blog.nextive.com/wp-content/uploads/2011/07/image051.png" alt="Managed Object Class" width="500" height="378" /></p>
<p>&nbsp;</p>
<p class="MsoNormal"><!--StartFragment--></p>
<p class="MsoNormal">
<p class="MsoNormal">
<p class="MsoNormal">Then we have to select the entities from the Data Model that we want to create Data Classes for.</p>
<p class="MsoNormal"><img class="aligncenter size-full wp-image-331" title="Data Model Entities" src="http://blog.nextive.com/wp-content/uploads/2011/07/image021.png" alt="Data Model Entities" width="500" height="326" /></p>
<p>&nbsp;</p>
<p class="MsoNormal">
<p class="MsoNormal">After this we are going to have the Data Classes generated in our project.</p>
<p class="MsoNormal">
<h3>Creating a Managed Object Context</h3>
<p class="MsoNormal">In order to make CRUD (create, read, update, delete) operations we need an instance of a Managed Object Context. To create a <strong>Managed Object Context</strong> we need to follow these steps:</p>
<div>
<ol>
<li>Create a <strong>Managed Object Model</strong> with the defined <strong>Data Model</strong>.</li>
<li>Create a <strong>Persistent Store Coordinator </strong>with the created <strong>Managed Object Model</strong> and set a <strong>Persistent Object Store</strong> on it.</li>
<li>Finally, create a <strong>Managed Object Context</strong> and set the created <strong>Persistent Store Coordinator</strong>.</li>
</ol>
</div>
<table border="0" cellspacing="0" cellpadding="10" width="90%" align="center" bgcolor="#fafafa">
<tbody>
<tr>
<td>
<p class="codigogreen">// 1. Create a Managed Object Model with the defined Data Model.</p>
<p class="codigovioleta">NSManagedObjectModel<span class="codigonegro"> *</span><span class="codigoturquesa">managedObjectModel</span><span class="codigonegro"> =<span> </span></span></p>
<p class="codigopurpura"><span class="codigonegro">[</span><span class="codigovioletita">NSManagedObjectModel</span><span class="codigonegro"> </span>mergedModelFromBundles<span class="codigonegro">:</span><span class="codigorojo">nil</span><span class="codigonegro">];<span> </span></span></p>
<p class="codigotipo1"><span> </span></p>
<p class="codigogreen">// 2. Create a Persistent Store Coordinator with the created Managed Object Model and set a Persistent Object Store on it.</p>
<p class="codigovioleta">NSError<span class="codigonegro"> *</span><span class="codigovioleta3">error</span><span class="codigonegro"> = </span><span class="codigorojo">nil</span><span class="codigonegro">;</span></p>
<p class="codigotipo2"><span> </span></p>
<p class="codigovioleta">NSPersistentStoreCoordinator<span class="codigonegro"> *</span><span class="codigoturquesa">persistentStoreCoordinator</span><span class="codigonegro"> =<span> </span></span></p>
<p class="codigopurpura"><span class="codigonegro">[[</span><span class="codigovioletita">NSPersistentStoreCoordinator</span><span class="codigonegro"> </span>alloc<span class="codigonegro">] </span>initWithManagedObjectModel<span class="codigonegro">:</span><span class="codigoturquesa">managedObjectModel</span><span class="codigonegro">];</span></p>
<p class="codigotipo1"><span> </span></p>
<p class="codigoturquesa1"><span class="codigorojo">if</span><span class="codigonegro"> (![</span>persistentStoreCoordinator<span class="codigonegro"> </span><span class="codigovioleta1">addPersistentStoreWithType</span><span class="codigonegro">:</span><span class="codigovioletita">NSSQLiteStoreType</span><span class="codigonegro"><span> </span></span></p>
<p class="codigonegro2"><span class="codigotipo3"><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span></span> <span> </span><span class="codigovioleta1">configuration</span>:<span class="codigorojo">nil</span><span> </span></p>
<p class="codigonegro2"><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span> <span> <span> </span> </span><span class="codigovioleta1">URL</span>:storeURL <span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span class="codigovioleta1">options</span>:<span class="codigorojo">nil</span> <span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span><span> <span> </span> </span><span class="codigovioleta1">error</span>:&amp;<span class="codigoturquesa">error</span>]) {</p>
<p class="codigovioleta3"><span class="codigonegro"><span> </span><span> </span></span><span class="codigovioleta1">NSLog</span><span class="codigonegro">(</span>@&#8221;Unresolved error %@, %@&#8221;<span class="codigonegro">, </span><span class="codigoturquesa">error</span><span class="codigonegro">, [</span><span class="codigoturquesa">error</span><span class="codigonegro"> </span><span class="codigovioleta1">userInfo</span><span class="codigonegro">]);</span></p>
<p class="codigonegro2"><span> </span><span> </span><span class="codigovioleta1">abort</span>();</p>
<p class="codigonegro2">}<span> </span></p>
<p class="codigotipo1"><span> </span></p>
<p class="codigogreen">// 3. Create a Managed Object Context and set the created Persistent Store Coordinator.</p>
<p class="codigovioleta">NSManagedObjectContext<span class="codigonegro"> *</span><span class="codigoturquesa">managedObjectContext</span><span class="codigonegro"> =<span> </span></span></p>
<p class="codigovioleta"><span class="codigonegro">[[</span>NSManagedObjectContext<span class="codigonegro"> </span><span class="codigovioleta1">alloc</span><span class="codigonegro">] </span><span class="codigovioleta1">init</span><span class="codigonegro">];</span></p>
<p class="codigotipo1"><span> </span></p>
<p class="codigoturquesa1"><span class="codigonegro">[</span>managedObjectContext<span class="codigonegro"> </span><span class="codigovioleta1">setPersistentStoreCoordinator</span><span class="codigonegro">:</span>persistentStoreCoordinator<span class="codigonegro">];</span></p>
</td>
</tr>
</tbody>
</table>
<h3>Creating a Managed Object</h3>
<p>Now we are going to create two instances for the entity Team and one instance for the entity Match. Match has two relationships with the entity Team. That represents the teams that are going to play on that match.</p>
<table border="0" cellspacing="0" cellpadding="10" width="90%" align="center" bgcolor="#fafafa">
<tbody>
<tr>
<td>
<p class="codigogreen">// Create a new instance of Team (NSManagedObject subclass). We have to set the Entity Name and the created Managed Object Context</p>
<p class="codigopurpura"><span class="codigoturquesa">Team</span><span class="codigonegro"> *</span><span class="codigoturquesa">localTeam</span><span class="codigonegro"> = (</span><span class="codigoturquesa">Team</span><span class="codigonegro">*)[</span><span class="codigovioletita">NSEntityDescription</span><span class="codigonegro"> </span>insertNewObjectForEntityForName<span class="codigonegro">:</span><span class="codigof60000">@"Team"</span><span class="codigonegro"><span> </span></span></p>
<p class="codigonegro2"><span class="codigotipo3"><span> </span><span> </span><span> </span><span> </span><span> </span></span><span> <span> </span></span><span class="codigovioleta1">inManagedObjectContext</span>:<span class="codigoturquesa">managedObjectContext</span>];</p>
<p class="codigotipo1"><span> </span></p>
<p class="codigoturquesa1">localTeam<span class="codigonegro1">.</span>name<span class="codigonegro"> = </span><span class="codigof60000">@&#8221;Manchester&#8221;</span><span class="codigonegro">;</span></p>
<p class="codigotipo2">
<p class="codigogreen">// Create another instance of Team</p>
<p class="codigopurpura"><span class="codigoturquesa">Team</span><span class="codigonegro"> *</span><span class="codigoturquesa">visitingTeam</span><span class="codigonegro"> = (</span><span class="codigoturquesa">Team</span><span class="codigonegro">*)[</span><span class="codigovioletita">NSEntityDescription</span><span class="codigonegro"> </span>insertNewObjectForEntityForName<span class="codigonegro">:</span><span class="codigof60000">@"Team"</span></p>
<p class="codigootro">inManagedObjectContext<span class="codigonegro">:</span><span class="codigoturquesa">managedObjectContext</span><span class="codigonegro">];</span></p>
<p class="codigotipo2"><span> </span></p>
<p class="codigoturquesa1">visitingTeam<span class="codigonegro1">.</span>name<span class="codigonegro"> = </span><span class="codigof60000">@&#8221;Barcelona&#8221;</span><span class="codigonegro">;</span></p>
<p class="codigotipo2">
<p class="codigogreen">// Create an instance for Match entity with the created Teams</p>
<p class="codigopurpura"><span class="codigoturquesa">Match</span><span class="codigonegro"> *</span><span class="codigoturquesa">match</span><span class="codigonegro"> = (</span><span class="codigoturquesa">Match</span><span class="codigonegro">*)[</span><span class="codigovioletita">NSEntityDescription</span><span class="codigonegro"> </span>insertNewObjectForEntityForName<span class="codigonegro">:</span><span class="codigof60000">@"Match"</span><span class="codigonegro"><span> </span></span></p>
<p class="codigotipo4"><span class="codigotipo3"><span> </span><span> </span><span> </span></span><span> </span><span class="codigovioleta1">inManagedObjectContext</span>:<span class="codigoturquesa">managedObjectContext</span>];</p>
<p class="codigotipo2">
<p class="codigogreen">// We are going to use a random value to set the match’s result</p>
<p class="codigopurpura">srandom<span class="codigonegro">(</span>time<span class="codigonegro">(</span><span class="codigorojo">NULL</span><span class="codigonegro">));</span></p>
<p class="codigotipo2">
<p class="codigoturquesa1">match<span class="codigonegro1">.</span>scoreVisitingTeam<span class="codigonegro"> = [</span><span class="codigovioletita">NSNumber</span><span class="codigonegro"> </span><span class="codigovioleta1">numberWithInt</span><span class="codigonegro">:</span><span class="codigovioleta1">random</span><span class="codigonegro">()%</span><span class="codigo7600ec">5</span><span class="codigonegro">];</span></p>
<p class="codigoturquesa1">match<span class="codigonegro1">.</span>scoreLocalTeam<span class="codigonegro"> = [</span><span class="codigovioletita">NSNumber</span><span class="codigonegro"> </span><span class="codigovioleta1">numberWithInt</span><span class="codigonegro">:</span><span class="codigovioleta1">random</span><span class="codigonegro">()%</span><span class="codigo7600ec">5</span><span class="codigonegro">];</span></p>
<p class="codigoturquesa1">match<span class="codigonegro1">.</span>date<span class="codigonegro"> = [</span><span class="codigovioletita">NSDate</span><span class="codigonegro"> </span><span class="codigovioleta1">date</span><span class="codigonegro">];</span></p>
<p class="codigoturquesa1">match<span class="codigonegro1">.</span>visitingTeam<span class="codigonegro"> = </span>visitingTeam<span class="codigonegro">;</span></p>
<p class="codigoturquesa1">match<span class="codigonegro1">.</span>localTeam<span class="codigonegro"> = </span>localTeam<span class="codigonegro">;</span></p>
<p class="codigotipo2"><span> </span></p>
<p class="codigogreen">// Persist the changes in the Managed Object Context</p>
<p class="codigovioleta">NSError<span class="codigonegro"> *</span><span class="codigoturquesa">error</span><span class="codigonegro"> = </span><span class="codigorojo">nil</span><span class="codigonegro">;</span></p>
<p class="codigoturquesa1"><span class="codigorojo">if</span><span class="codigonegro"> (</span>managedObjectContext<span class="codigonegro"> != </span><span class="codigorojo">nil</span><span class="codigonegro">) {</span></p>
<p class="codigoturquesa1"><span class="codigonegro"><span> </span></span><span class="codigorojo">if</span><span class="codigonegro"> (![</span>managedObjectContext<span class="codigonegro"> </span><span class="codigovioleta1">save</span><span class="codigonegro">:&amp;</span>error<span class="codigonegro">]) {</span></p>
<p class="codigovioleta3"><span class="codigonegro"><span> </span></span><span class="codigovioleta1">NSLog</span><span class="codigonegro">(</span>@&#8221;Unresolved error %@, %@&#8221;<span class="codigonegro">, </span><span class="codigoturquesa">error</span><span class="codigonegro">, [</span><span class="codigoturquesa">error</span><span class="codigonegro"> </span><span class="codigovioleta1">userInfo</span><span class="codigonegro">]);</span></p>
<p class="codigonegro2"><span> </span><span class="codigovioleta1">abort</span>();</p>
<p class="codigonegro2"><span> </span>}<span> </span></p>
<p class="codigonegro2">}</p>
</td>
</tr>
</tbody>
</table>
<h3>Executing Fetches</h3>
<p>In order to execute fetches we need to create a <strong>NSFetchRequest</strong> instance. We need to define an entity name, a predicate and the order of the data result. Then we use the created <strong>Managed Object Context</strong> to execute the generated <strong>NSFetchRequest</strong> instance. The <strong>Managed Object Context </strong>returns an array of <strong>NSManagedObject </strong>objects.</p>
<p><img class="aligncenter size-full wp-image-343" title="Fetch Request" src="http://blog.nextive.com/wp-content/uploads/2011/07/image001.png" alt="Fetch Request" width="446" height="494" /></p>
<table border="0" cellspacing="0" cellpadding="10" width="90%" align="center" bgcolor="#fafafa">
<tbody>
<tr>
<td>
<p class="codigogreen">// Create a fetch request instance.</p>
<p class="codigovioleta">NSFetchRequest<span class="codigonegro"> *fetchRequest = [[[</span>NSFetchRequest<span class="codigonegro"> </span><span class="codigovioleta1">alloc</span><span class="codigonegro">] </span><span class="codigovioleta1">init</span><span class="codigonegro">] </span><span class="codigovioleta1">autorelease</span><span class="codigonegro">];</span></p>
<p class="codigotipo1"><span> </span></p>
<p class="codigogreen">// Set the entity.</p>
<p class="codigovioleta">NSEntityDescription<span class="codigonegro"> *entity = [</span>NSEntityDescription<span class="codigonegro"> </span><span class="codigovioleta1">entityForName</span><span class="codigonegro">:</span><span class="codigof60000">@"Match"</span><span class="codigonegro"><span> </span></span></p>
<p class="codigopurpura"><span class="codigonegro"><span> <span> </span><span> </span><span> </span><span> </span><span> </span> </span></span>inManagedObjectContext<span class="codigonegro">:</span><span class="codigoturquesa">managedObjectContext</span><span class="codigonegro">];</span></p>
<p class="codigonegro2">[fetchRequest <span class="codigovioleta1">setEntity</span>:entity];</p>
<p class="codigotipo1"><span> </span></p>
<p class="codigogreen">// Set the predicate (it returns all matches played by the team “Manchester”)</p>
<p class="codigovioleta3"><span class="codigovioletita">NSPredicate</span><span class="codigonegro"> *predicate = [</span><span class="codigovioletita">NSPredicate</span><span class="codigonegro"> </span><span class="codigovioleta1">predicateWithFormat</span><span class="codigonegro">:</span>@"localTeam.name = 'Manchester' or visitingTeam.name = 'Manchester'"<span class="codigonegro">];</span></p>
<p class="codigonegro2">[fetchRequest <span class="codigovioleta1">setPredicate</span>:predicate];</p>
<p class="codigotipo1"><span> </span></p>
<p class="codigogreen">// Set the order criteria</p>
<p class="codigovioleta">NSSortDescriptor<span class="codigonegro"> *sortDescriptor = [[[</span>NSSortDescriptor<span class="codigonegro"> </span><span class="codigovioleta1">alloc</span><span class="codigonegro">] </span><span class="codigovioleta1">initWithKey</span><span class="codigonegro">:</span><span class="codigof60000">@&#8221;date&#8221;</span><span class="codigonegro"><span> </span></span></p>
<p class="codigopurpura"><span class="codigonegro1"><span> </span><span> </span><span> </span><span> </span><span> </span><span> </span></span>ascending<span class="codigonegro">:</span><span class="codigorojo">YES</span><span class="codigonegro">] </span>autorelease<span class="codigonegro">];</span></p>
<p class="codigonegro2">[fetchRequest <span class="codigovioleta1">setSortDescriptors</span>:[<span class="codigovioletita">NSArray</span> <span class="codigovioleta1">arrayWithObject</span>:sortDescriptor]];</p>
<p class="codigotipo1"><span> </span></p>
<p class="codigogreen">// Finally, execute the fetch request</p>
<p class="codigonegro2"><span class="codigovioletita">NSError</span> *error = <span class="codigorojo">nil</span>;</p>
<p class="codigonegro2"><span class="codigovioletita">NSArray</span> *results = [<span class="codigorojo">self</span><span class="codigotipo3">.</span><span class="codigovioletita">managedObjectContext</span> <span class="codigovioleta1">executeFetchRequest</span>:fetchRequest <span class="codigovioleta1">error</span>:&amp;error];</p>
</td>
</tr>
</tbody>
</table>
<h3>Deleting a Managed Object</h3>
<p>In order to delete Managed Objects we need to mark the objects that we want to delete through the Managed Object Context and then persist the changes.</p>
<table border="0" cellspacing="0" cellpadding="10" width="90%" align="center" bgcolor="#fafafa">
<tbody>
<tr>
<td>
<p class="codigogreen">// Get the NSManagedObject instance that we want to delete</p>
<p class="codigonegro2"><span class="codigoturquesa">Team</span> *<span class="codigoturquesa">team</span> = &#8230;;</p>
<p class="codigotipo2"><span> </span></p>
<p class="codigogreen">// Set that NSManagedObject instance as deleted</p>
<p class="codigoturquesa1"><span class="codigonegro">[</span>managedObjectContext<span class="codigonegro"> </span><span class="codigovioleta1">deleteObject</span><span class="codigonegro">:</span>team<span class="codigonegro">];</span></p>
<p class="codigotipo1"><span> </span></p>
<p class="codigogreen">// Persist the changes</p>
<p class="codigovioleta">NSError<span class="codigonegro"> *</span><span class="codigoturquesa">error</span><span class="codigonegro"> = </span><span class="codigorojo">nil</span><span class="codigonegro">;</span></p>
<p class="codigoturquesa1"><span class="codigorojo">if</span><span class="codigonegro"> (![</span>managedObjectContext<span class="codigonegro"> </span><span class="codigovioleta1">save</span><span class="codigonegro">:&amp;</span>error<span class="codigonegro">]) {</span></p>
<p class="codigotipo2"><span> </span><span> </span><span> </span></p>
<p class="codigovioleta3"><span class="codigonegro1"><span> </span></span><span class="codigovioleta1">NSLog</span><span class="codigonegro">(</span>@&#8221;Unresolved error %@, %@&#8221;<span class="codigonegro">, </span><span class="codigoturquesa">error</span><span class="codigonegro">, [</span><span class="codigoturquesa">error</span><span class="codigonegro"> </span><span class="codigovioleta1">userInfo</span><span class="codigonegro">]);</span></p>
<p class="codigopurpura"><span class="codigonegro"><span> </span></span>abort<span class="codigonegro">();</span></p>
<p class="codigonegro2">}<span> </span></p>
</td>
</tr>
</tbody>
</table>
<h3>Updating a Managed Object</h3>
<p>In order to update Managed Objects we just have to update its attributes values and then persist the changes.</p>
<table border="0" cellspacing="0" cellpadding="10" width="90%" align="center" bgcolor="#fafafa">
<tbody>
<tr>
<td>
<p class="codigogreen">// Get the NSManagedObject instance that we want to update</p>
<p class="codigoturquesa1">Match<span class="codigonegro"> *</span>match<span class="codigonegro"> = &#8230;;</span></p>
<p class="codigotipo2"><span> </span></p>
<p class="codigogreen">// Update some attribute</p>
<p class="codigoturquesa1">match<span class="codigonegro1">.</span>date<span class="codigonegro"> = [</span><span class="codigovioletita">NSDate</span><span class="codigonegro"> </span><span class="codigovioleta1">date</span><span class="codigonegro">];</span></p>
<p class="codigotipo2"><span> </span></p>
<p class="codigogreen">// Persist the changes</p>
<p class="codigovioleta">NSError<span class="codigonegro"> *</span><span class="codigoturquesa">error</span><span class="codigonegro"> = </span><span class="codigorojo">nil</span><span class="codigonegro">;</span></p>
<p class="codigotipo1"><span class="codigorojo">if</span><span class="codigonegro"> (![</span>managedObjectContext<span class="codigonegro"> </span><span class="codigovioleta1">save</span><span class="codigonegro">:&amp;</span>error<span class="codigonegro">]) {</span></p>
<p class="codigotipo2"><span class="codigootro"> </span><span> </span><span> </span></p>
<p class="codigovioleta3"><span class="codigonegro1"><span> </span></span><span class="codigovioleta1">NSLog</span><span class="codigonegro">(</span>@&#8221;Unresolved error %@, %@&#8221;<span class="codigonegro">, </span><span class="codigoturquesa">error</span><span class="codigonegro">, [</span><span class="codigoturquesa">error</span><span class="codigonegro"> </span><span class="codigovioleta1">userInfo</span><span class="codigonegro">]);</span></p>
<p class="codigopurpura"><span class="codigonegro"><span> </span></span>abort<span class="codigonegro">();</span></p>
<p class="codigonegro2">}<span> </span></p>
</td>
</tr>
</tbody>
</table>
<h3>Next steps</h3>
<p>I’m going to mention some topics that you should read if you want to learn more about Core Data:</p>
<ul>
<li>NSFetchedResultController: This is a controller used to optimize the use of memory when we have to show information on a Table View.</li>
<li>Versions and Migration: Core Data has some tools to automatically implement updates on our data model.</li>
<li>Threading: It’s important to understand how to use Core Data on multithread scenarios.</li>
</ul>
<h3>References</h3>
<ul>
<li><a href="http://developer.apple.com/library/ios/#documentation/DataManagement/Conceptual/iPhoneCoreData01/Introduction/Introduction.html" target="_new">Core Data Tutorial for iOS</a></li>
<li><a href="http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CoreData/cdProgrammingGuide.html" target="_new">Introduction to Core Data Programming Guide</a></li>
<li>The frirst seven chapters from the book “More iPhone 3 Development” - Dave Mark and Jeff LaMarche.</li>
<li>Book: Pro Core Data for iOS - Michel Privat and Robert Warner.<!--EndFragment--><!--EndFragment--></li>
</ul>
<h5><strong>Author:</strong> Pablo Romero</h5>
]]></content:encoded>
			<wfw:commentRss>http://blog.nextive.com/310-core-data/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

