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

<channel>
	<title>random facts girl &#187; cocoa</title>
	<atom:link href="http://www.soychicka.com/tag/cocoa/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.soychicka.com</link>
	<description></description>
	<lastBuildDate>Sat, 03 Jul 2010 22:43:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Creating a map-based iPhone app</title>
		<link>http://www.soychicka.com/2009/07/18/creating-a-map-based-iphone-app/</link>
		<comments>http://www.soychicka.com/2009/07/18/creating-a-map-based-iphone-app/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 19:52:44 +0000</pubDate>
		<dc:creator>soychicka</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://www.soychicka.com/?p=694</guid>
		<description><![CDATA[The day word went out that OS 3.0 would finally include access to the google MapKit was the tipping point that finally got me to shell out the $99 to join the iPhone developer program.  Unfortunately, at the time, documentation was sparse, and although the back end was in place, I couldn&#8217;t figure out [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>The day word went out that OS 3.0 would finally include access to the google MapKit was the tipping point that finally got me to shell out the $99 to join the iPhone developer program.  Unfortunately, at the time, documentation was sparse, and although the back end was in place, I couldn&#8217;t figure out how to display my annotations.</p>
<p>So I put my map-based projects on hold&#8230;  until yesterday, that is, when I came across <a href="http://blog.objectgraph.com/index.php/2009/04/02/iphone-sdk-30-playing-with-map-kit/" target="_blank">this easy-to-understand 3-part  tutorial with sample code</a> that very clearly shows how all the pieces are put together.  A simple &#8220;Dude, where&#8217;s my car&#8221; app shows how to  gets your current location, then allows you to place a marker at your current location.</p>
<p>Now, the original developers intent was simply to provide an example of how to use MapKit, so I&#8217;m not chiding them for lack of foresight in any way&#8230; but in its current state, it&#8217;s a bit too simplistic to be really useful as a parking app.  But it could easily be tinkered with to provide additional functionality to make it useful:</p>
<ul>
<li>allow you to add markers at a location you define (in case you forgot to set where you parked when you were there)</li>
<li>allow you to set a timer to let you know when your meter is about to run out (or in SF, when the two-hour period of time for people without permits has expired)</li>
<li>store location info when you exit the app (&#8217;cause as is, you lose it when you answer a phone call, etc.)</li>
<li>etc., etc.</li>
</ul>
<p>Regardless, for whatever app you need a map, <a href="http://blog.objectgraph.com/index.php/2009/04/02/iphone-sdk-30-playing-with-map-kit/" target="_blank">this project</a> is a great start for learning how to get started with MapKit.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.soychicka.com/2009/07/18/creating-a-map-based-iphone-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Working with Sample Code: Rename your project in Xcode 3.x</title>
		<link>http://www.soychicka.com/2009/07/18/working-with-sample-code-rename-your-project-in-xcode-3-x/</link>
		<comments>http://www.soychicka.com/2009/07/18/working-with-sample-code-rename-your-project-in-xcode-3-x/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 19:51:59 +0000</pubDate>
		<dc:creator>soychicka</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://www.soychicka.com/?p=691</guid>
		<description><![CDATA[When I&#8217;m learning how to code in a new language, I like to start off some sample code that I know works, then mutilate it until it bears no resemblance to what the original developer came up with&#8230; but making sure that it still works at each step along the way.
But my adventures with Cocoa/Obj-C [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>When I&#8217;m learning how to code in a new language, I like to start off some sample code that I know works, then mutilate it until it bears no resemblance to what the original developer came up with&#8230; but making sure that it still works at each step along the way.</p>
<p>But my adventures with Cocoa/Obj-C present a new challenge: no stand-alone php or perl files that can easily be shuffled and renamed&#8230; when you work with a language that requires the software be compiled, there&#8217;s a much deeper structure that needs to be modified in order to assign a new identity to the project.</p>
<p>Sadly, Xcode doesn&#8217;t have an option that allows you to create a new project from an existing project with a new name  (note to Apple: this would be a great feature to include in 3.2, *wink wink nudge nudge*).</p>
<p>But in the meantime, when you have some sample code you want to play around with, but still hang on to the original and not muck up your hard drive with copies of copies of duplicates of copies&#8230; try this:<br />
<span id="more-691"></span></p>
<ol>
<li>Make a copy of the folder containing the project, and rename it from
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">OldProjectName</div></td></tr></tbody></table></div>
<p>to</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">NewProjectName</div></td></tr></tbody></table></div>
<p>.</li>
<li>I like to lock the
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">OldProjectName</div></td></tr></tbody></table></div>
<p>folder to make sure I don&#8217;t accidentally muck up the original: (select</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">OldProjectName</div></td></tr></tbody></table></div>
<p>folder, command-i, under General click the Locked checkbox.)  You can always undo it later.</li>
<li>In the
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">NewProjectName</div></td></tr></tbody></table></div>
<p>folder, rename:</p>
<ul>
<li>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;OldProjectName.pch</div></td></tr></tbody></table></div>
<p>to</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">NewProjectName.pch</div></td></tr></tbody></table></div>
</li>
<li>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;OldProjectName.xcodeproj</div></td></tr></tbody></table></div>
<p>to</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">NewProjectName.xcodeproj</div></td></tr></tbody></table></div>
</li>
<li>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">OldProjectName-info.plist</div></td></tr></tbody></table></div>
<p>(if it exists) to</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">NewProjectName-info.plist</div></td></tr></tbody></table></div>
</li>
</ul>
</li>
<li>Delete the build folder.</li>
<li>Right-click
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">NewProjectName.xcodeproj</div></td></tr></tbody></table></div>
<p>and select Show Package Contents.</li>
<li>Open
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">project.pbxproj</div></td></tr></tbody></table></div>
<p>in your favorite text editor and do a find/replace to update all instances of</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">OldProjectName</div></td></tr></tbody></table></div>
<p>to</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">NewProjectName</div></td></tr></tbody></table></div>
<p>. (see #10 if any of your class files</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">OldProjectName</div></td></tr></tbody></table></div>
<p>have in the filename.</li>
<li>Open the project in Xcode.</li>
<li>From the
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Build menu</div></td></tr></tbody></table></div>
<p>, select</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Clean all targets</div></td></tr></tbody></table></div>
<p>.</li>
<li>Try to build and see if it goes.  If you&#8217;re working on an iPhone app, try it out in the simulator first&#8230; if you have any provisioning files for the old application name, you&#8217;ll have to go through the steps to create a new one before you can test it on your device.</li>
<li>if any of your classes contain
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">OldProjectName</div></td></tr></tbody></table></div>
<p>in the class fileName, you&#8217;ll need to</p>
<ul>
<li>update the names of any .h/.m files that include the name of the project&#8230;  don&#8217;t forget you&#8217;ll have to update import statements too</li>
<li>rename any of the
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">@interface</div></td></tr></tbody></table></div>
<p>and</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">@implementation</div></td></tr></tbody></table></div>
<p>declarations that contain</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">OldProjectName</div></td></tr></tbody></table></div>
<p>to contain</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">NewProjectName</div></td></tr></tbody></table></div>
<p>.</li>
<li>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Build</div></td></tr></tbody></table></div>
<p>&gt;</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Clean all targets</div></td></tr></tbody></table></div>
<p>again, build again, and fix anything you missed.</li>
</ul>
</li>
</ol>
<p>You now have a fully renamed project, ready for mutilation.  Enjoy!</p>
<p>Thanks to Aleksandar Vacić for posting <a href="http://aplus.rs/cocoa/how-to-rename-project-in-xcode-3x/">this tutorial</a> that I used to learn the basics of renaming a project&#8230;</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.soychicka.com/2009/07/18/working-with-sample-code-rename-your-project-in-xcode-3-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
