<?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>aplus moments &#187; Programming</title>
	<atom:link href="http://aplus.rs/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://aplus.rs</link>
	<description>mostly modern web design with get-a-life sparks</description>
	<lastBuildDate>Tue, 03 Aug 2010 15:39:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Color of raw image pixel data and iPhone 4’s retina display</title>
		<link>http://aplus.rs/programming/color-of-raw-image-pixel-data-and-iphone-4s-retina-display/</link>
		<comments>http://aplus.rs/programming/color-of-raw-image-pixel-data-and-iphone-4s-retina-display/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 21:47:08 +0000</pubDate>
		<dc:creator>Aleksandar</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[2d]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[pixel]]></category>

		<guid isPermaLink="false">http://aplus.rs/?p=544</guid>
		<description><![CDATA[On my first taste of resolution independent programming - how iPhone 4's huge screen ppi is influencing the pixel color readout.]]></description>
			<content:encoded><![CDATA[<p>In my <a href="http://codeaplus.com/moodlamp/">Ambient Mood Lamp</a> app, I have a color picker where you can choose the background color by simply tapping the color on an image, like this:</p>
<div id="attachment_545" class="wp-caption aligncenter" style="width: 270px"><img class="size-full wp-image-545" title="iphone-colorswirl4" src="http://aplus.rs/wpa/wp-content/uploads/2010/07/iphone-colorswirl4.png" alt="" width="260" height="260" /><p class="wp-caption-text">Color swirl</p></div>
<p>What I need from there is the actual RGB representation of the pixel color. To get that, there’s quite a bit of code involved. A large part of it is taken from Apple’s <a href="http://developer.apple.com/mac/library/qa/qa2007/qa1509.html">technical note QA1509</a>. </p>
<p>Pixel color fetching is done in this <code>if</code> block from that article:</p>
<div class="igBar"><span id="lobjc-1"><a href="#" onclick="javascript:showPlainTxt('objc-1'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">OBJC:</span>
<div id="objc-1">
<pre class="objc">
<ol>
<li style="color:#333;">
<div style=""><span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>data != <span style="color: #a61390;">NULL</span><span style="color: #002200;">&#41;</span></div>
</li>
<li style="color:#26536A;">
<div style=""><span style="color: #002200;">&#123;</span></div>
</li>
<li style="color:#333;">
<div style="">    <span style="color: #11740a; font-style: italic;">// **** You have a pointer to the image data ****</span></div>
</li>
<li style="color:#26536A;">
<div style="">    <span style="color: #11740a; font-style: italic;">// **** Do stuff with the data here ****</span></div>
</li>
<li style="color:#333;">
<div style=""><span style="color: #002200;">&#125;</span> </div>
</li>
</ol>
</pre>
</div>
</div>
<p></p>
<p>I picked up the code to get the pixel color from some web page I lost track of. This is the code:</p>
<div class="igBar"><span id="lobjc-2"><a href="#" onclick="javascript:showPlainTxt('objc-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">OBJC:</span>
<div id="objc-2">
<pre class="objc">
<ol>
<li style="color:#333;">
<div style=""><span style="color: #a61390;">int</span> offset = <span style="color: #002200;">&#40;</span><span style="color: #002200;">&#40;</span>w*round<span style="color: #002200;">&#40;</span>point.y<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span>+round<span style="color: #002200;">&#40;</span>point.x<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span> * <span style="color: #2400d9;color:#800000;">4</span>;</div>
</li>
<li style="color:#26536A;">
<div style=""><span style="color: #a61390;">int</span> alpha =  data<span style="color: #002200;">&#91;</span>offset<span style="color: #002200;">&#93;</span>;</div>
</li>
<li style="color:#333;">
<div style=""><span style="color: #a61390;">int</span> red = data<span style="color: #002200;">&#91;</span>offset+<span style="color: #2400d9;color:#800000;">1</span><span style="color: #002200;">&#93;</span>;</div>
</li>
<li style="color:#26536A;">
<div style=""><span style="color: #a61390;">int</span> green = data<span style="color: #002200;">&#91;</span>offset+<span style="color: #2400d9;color:#800000;">2</span><span style="color: #002200;">&#93;</span>;</div>
</li>
<li style="color:#333;">
<div style=""><span style="color: #a61390;">int</span> blue = data<span style="color: #002200;">&#91;</span>offset+<span style="color: #2400d9;color:#800000;">3</span><span style="color: #002200;">&#93;</span>;</div>
</li>
<li style="color:#26536A;">
<div style="">color = <span style="color: #002200;">&#91;</span>UIColor colorWithRed:<span style="color: #002200;">&#40;</span>red/<span style="color: #2400d9;color:#800000;">255</span>.0f<span style="color: #002200;">&#41;</span> green:<span style="color: #002200;">&#40;</span>green/<span style="color: #2400d9;color:#800000;">255</span>.0f<span style="color: #002200;">&#41;</span> blue:<span style="color: #002200;">&#40;</span>blue/<span style="color: #2400d9;color:#800000;">255</span>.0f<span style="color: #002200;">&#41;</span> alpha:<span style="color: #002200;">&#40;</span>alpha/<span style="color: #2400d9;color:#800000;">255</span>.0f<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</span>; </div>
</li>
</ol>
</pre>
</div>
</div>
<p></p>
<p><code>w</code> is the width of one row of data, and point <code>{x,y}</code> is where the screen was touched. The <code>* 4</code> in the first line means 4 bytes of raw data per pixel. Well, 4 bytes when your screen res is up to 160ish ppi. On iPhone 4’s Retina Display, with its 326ppi resolution, this should be 8. Which means correct code now is:</p>
<div class="igBar"><span id="lobjc-3"><a href="#" onclick="javascript:showPlainTxt('objc-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">OBJC:</span>
<div id="objc-3">
<pre class="objc">
<ol>
<li style="color:#333;">
<div style=""><span style="color: #a61390;">int</span> offset = <span style="color: #002200;">&#40;</span><span style="color: #002200;">&#40;</span>w*round<span style="color: #002200;">&#40;</span>point.y<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span>+round<span style="color: #002200;">&#40;</span>point.x<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span> * <span style="color: #2400d9;color:#800000;">4</span> * <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIScreen mainScreen<span style="color: #002200;">&#93;</span> scale<span style="color: #002200;">&#93;</span>; </div>
</li>
</ol>
</pre>
</div>
</div>
<p></p>
<p>Welcome to wonderful world of resolution independent programming.</p>
]]></content:encoded>
			<wfw:commentRss>http://aplus.rs/programming/color-of-raw-image-pixel-data-and-iphone-4s-retina-display/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Better icons for your iPhone apps on the iPad</title>
		<link>http://aplus.rs/programming/better-icons-for-your-iphone-apps-on-the-ipad/</link>
		<comments>http://aplus.rs/programming/better-icons-for-your-iphone-apps-on-the-ipad/#comments</comments>
		<pubDate>Sun, 23 May 2010 01:10:10 +0000</pubDate>
		<dc:creator>Aleksandar</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[icons]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iphonedev]]></category>

		<guid isPermaLink="false">http://aplus.rs/?p=530</guid>
		<description><![CDATA[Treat iPhone-only apps the same way as universal apps and iPad will correctly use proper icon.]]></description>
			<content:encoded><![CDATA[<p>When you have iPhone apps installed on the iPad, chances are they are doubly-ugly: they look pixelated when doubled and their icons are even more ugly extrapolated from 57x57px to 72x72px.</p>
<p>Recently, David Frampton posted <a href="http://www.flickr.com/photos/8953623@N06/4583207492/">great idea</a> how Apple should have done this (the idea got picked by Daring Fireball, TUAW and many others). While idea is great, it’s more than doubtful that Apple would do this.</p>
<p>What Apple would likely prefer is that you, as developer, make an iPad version of your iPhone app and use the full capability of the device. In the process, you’ll create proper iPad icons and no ugliness then. In the Apple’s DevForums, there’s a <a href="https://devforums.apple.com/thread/43845?tstart=0">thread with guidelines</a> on how to populate <i>App</i>–info.plist file and what icon files are needed.</p>
<p>In there, it says that for iPhone-only apps you need to populate <code>CFBundleIconFile</code> key with 57px icon. However, if you move down a bit, you’ll find section on setting up universal app. <strong>Do that</strong>, even if your app is not universal and voila — iPad will use the proper icon for your iPhone-only app.</p>
<div id="attachment_531" class="wp-caption aligncenter" style="width: 419px"><a href="http://aplus.rs/wpa/wp-content/uploads/2010/05/Screen-shot-2010-05-23-at-02.33.02.png"><img src="http://aplus.rs/wpa/wp-content/uploads/2010/05/Screen-shot-2010-05-23-at-02.33.02.png" alt="" title="Setting up icon meta data" width="409" height="146" class="size-full wp-image-531" /></a><p class="wp-caption-text">Setting up icon meta data, so it displays proper icons on iPhone/iPad</p></div>
<p>The settings above are from my <a href="http://codeaplus.com/quickie/">Quickie to do</a> app — here’s before and after:</p>
<div id="attachment_532" class="wp-caption aligncenter" style="width: 674px"><img src="http://aplus.rs/wpa/wp-content/uploads/2010/05/Pastebot-2010-05-23-02.32-2.jpg" alt="" title="Quickie icon facelift" width="664" height="229" class="size-full wp-image-532" /><p class="wp-caption-text">Quickie icon on the iPad, before and after</p></div>
<p>Much better looking.</p>
]]></content:encoded>
			<wfw:commentRss>http://aplus.rs/programming/better-icons-for-your-iphone-apps-on-the-ipad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Always use isEqualToString for string comparisons</title>
		<link>http://aplus.rs/programming/always-use-isequaltostring-for-string-comparisons/</link>
		<comments>http://aplus.rs/programming/always-use-isequaltostring-for-string-comparisons/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 23:28:10 +0000</pubDate>
		<dc:creator>Aleksandar</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[cocoa touch]]></category>
		<category><![CDATA[core data]]></category>
		<category><![CDATA[nsstring]]></category>

		<guid isPermaLink="false">http://aplus.rs/?p=516</guid>
		<description><![CDATA[Always, always, always test and re-test your iPhone app on the actual device. Simulator can trick you in many ways. Here's one, involving string comparison.]]></description>
			<content:encoded><![CDATA[<p>While working on my iPhone app <a href="http://codeaplus.com/quickie/">Quickie</a>, I encountered one of many examples why you must <em>always check your code on the actual device</em>.</p>
<p>Quickie uses Core Data for storage and in one particular place I was comparing the <code>NSString</code> variable to a <code>NSString</code>–typed property of my CoreData class, <code>QuickieList</code>. Like this:</p>
<div class="igBar"><span id="lobjc-4"><a href="#" onclick="javascript:showPlainTxt('objc-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">OBJC:</span>
<div id="objc-4">
<pre class="objc">
<ol>
<li style="color:#333;">
<div style=""><span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>QuickieList.listName != theListName<span style="color: #002200;">&#41;</span> </div>
</li>
</ol>
</pre>
</div>
</div>
<p></p>
<p><code>listName</code> is defined as <code>NSString</code> and <code>theListName</code> is obviously that as well. In this particular instance, both of those had the value of “test”.<br />
In the iPhone Simulator (running on 10.6.2) this comparison returned <code>false</code>, but on the iPhone running 3.1.2 it returned <code>true</code>. When changed into:</p>
<div class="igBar"><span id="lobjc-5"><a href="#" onclick="javascript:showPlainTxt('objc-5'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">OBJC:</span>
<div id="objc-5">
<pre class="objc">
<ol>
<li style="color:#333;">
<div style=""><span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>!<span style="color: #002200;">&#91;</span>QuickieList.listName isEqualToString:theListName<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span> </div>
</li>
</ol>
</pre>
</div>
</div>
<p></p>
<p>result was the same.</p>
<p>Never – I repeat — <em>never</em> assume that simulator testing will be fine, even for seemingly small things. It can bite you when you least expect it.</p>
]]></content:encoded>
			<wfw:commentRss>http://aplus.rs/programming/always-use-isequaltostring-for-string-comparisons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UITextField.text is not always there</title>
		<link>http://aplus.rs/programming/uitextfield-text-is-not-always-there/</link>
		<comments>http://aplus.rs/programming/uitextfield-text-is-not-always-there/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 08:25:59 +0000</pubDate>
		<dc:creator>Aleksandar</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[cocoa touch]]></category>
		<category><![CDATA[uitextfield]]></category>

		<guid isPermaLink="false">http://aplus.rs/?p=515</guid>
		<description><![CDATA[Explaining a not so obvious issue with UITextField.text when checking is the text empty.]]></description>
			<content:encoded><![CDATA[<p>If you have UITextField on the page and you need to validate is there something in it (so if yes you can save the input or something), you might do something like this:</p>
<div class="igBar"><span id="lobjc-6"><a href="#" onclick="javascript:showPlainTxt('objc-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">OBJC:</span>
<div id="objc-6">
<pre class="objc">
<ol>
<li style="color:#333;">
<div style=""><span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>!<span style="color: #002200;">&#91;</span>addNewCellTextField.text isEqualToString:@<span style="color: #bf1d1a;">""</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span></div>
</li>
<li style="color:#26536A;">
<div style="">…</div>
</li>
<li style="color:#333;">
<div style=""><span style="color: #002200;">&#125;</span> </div>
</li>
</ol>
</pre>
</div>
</div>
<p></p>
<p>However, this will fail if the field is never touched. That is, until your user taps the field and it gets focus, UITextField.text is nil. Which means that condition above yields true, which is not what you want.<br />
Once it is touched though, this becomes an instance of NSString with value of @””. Thus, always use:</p>
<div class="igBar"><span id="lobjc-7"><a href="#" onclick="javascript:showPlainTxt('objc-7'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">OBJC:</span>
<div id="objc-7">
<pre class="objc">
<ol>
<li style="color:#333;">
<div style=""><span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>addNewCellTextField.text != <span style="color: #a61390;">nil</span> &amp;amp;&amp;amp; !<span style="color: #002200;">&#91;</span>addNewCellTextField.text isEqualToString:@<span style="color: #bf1d1a;">""</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span></div>
</li>
<li style="color:#26536A;">
<div style="">…</div>
</li>
<li style="color:#333;">
<div style=""><span style="color: #002200;">&#125;</span> </div>
</li>
</ol>
</pre>
</div>
</div>
<p></p>
<p>Watch out for this little trap hole.</p>
]]></content:encoded>
			<wfw:commentRss>http://aplus.rs/programming/uitextfield-text-is-not-always-there/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to find crash logs for iPhone applications on Mac, Vista and XP</title>
		<link>http://aplus.rs/apple/how-to-find-crash-logs-for-iphone-applications-on-mac-vista-and-xp/</link>
		<comments>http://aplus.rs/apple/how-to-find-crash-logs-for-iphone-applications-on-mac-vista-and-xp/#comments</comments>
		<pubDate>Sat, 08 Aug 2009 14:31:00 +0000</pubDate>
		<dc:creator>Aleksandar</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[crash logs]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://aplus.rs/?p=487</guid>
		<description><![CDATA[Detailed, heavily illustrated tutorials to locate iPhone crash logs, as synced through iTunes. This is very useful and needed if you need send these to a developer of the application you have and it's crashing.
Developers are people, people make mistakes. By investing a bit of your time, you'll help a developer fix the problems that plagues you and thus you get a better app in return.]]></description>
			<content:encoded><![CDATA[<p>iTunesConnect service — a web site that iPhone developers use to manage their published applications — has a separate area that will list all the synced crash reports from the application users.</p>
<p>However, not all of the crashes appear there, or are slow to appear. Thus, if you have a desperate problem with someone’s application, it’s a good idea to pick these up and send them to a developer.</p>
<p>Here’s how, in three major operations systems: Mac OS X, Windows Vista / Windows 7 and for Windows XP.</p>
<h3>iTunes sync</h3>
<p>Application crash logs are transfered to your computer each time you do a sync with the device, in the iTunes. Thus, first step is to sync with iTunes:</p>
<div id="attachment_489" class="wp-caption alignnone" style="width: 1024px"><img class="size-full wp-image-489" title="Picture-1" src="http://aplus.rs/wpa/wp-content/uploads/2009/08/Picture-1.jpg" alt="Sync the iPhone or iPod Touch through iTunes" width="1014" height="658" /><p class="wp-caption-text">Sync the iPhone or iPod Touch through iTunes</p></div>
<h3>Mac OS X</h3>
<p>On the Mac, crash logs are kept at:</p>
<pre><code>~/Library/Logs/CrashReporter/MobileDevice/&lt;DEVICE_NAME&gt;</code></pre>
<p>where ~ is your Home folder. Here’s an example:</p>
<div id="attachment_490" class="wp-caption alignnone" style="width: 772px"><img class="size-full wp-image-490" title="Picture-3" src="http://aplus.rs/wpa/wp-content/uploads/2009/08/Picture-3.png" alt="Crash logs on the Mac OS X. Device name is &quot;iPhone AV&quot; here" width="762" height="283" /><p class="wp-caption-text">Crash logs on the Mac OS X. Device name is “iPhone AV” here</p></div>
<p>There’s the <code>.crash</code> file and <code>.plist</code> file — archive them both and send to a developer. Actually, pick all the files you find there that have the name of the problematic application.</p>
<h3>Windows Vista / Windows 7</h3>
<p>Files are located here:</p>
<pre><code>C:\Users\&lt;USERNAME&gt;\AppData\Roaming\Apple computer\Logs\CrashReporter/MobileDevice/&lt;DEVICE_NAME&gt;</code></pre>
<p><code>AppData</code> folder is hidden by default, so here’s how to access it. Get into your personal folder:</p>
<div id="attachment_491" class="wp-caption alignnone" style="width: 810px"><img class="size-full wp-image-491" title="1" src="http://aplus.rs/wpa/wp-content/uploads/2009/08/1.png" alt="User folder, with Vista folder path" width="800" height="245" /><p class="wp-caption-text">User folder, with Vista folder path</p></div>
<p>Now click on the folder (address) bar which will change the display into Windows folder path and add <code>\AppData</code> to it, then click Enter.</p>
<div id="attachment_493" class="wp-caption alignnone" style="width: 592px"><img class="size-full wp-image-493" title="2" src="http://aplus.rs/wpa/wp-content/uploads/2009/08/21.png" alt="When clicked, the address bar changes into regular Windows folder path" width="582" height="169" /><p class="wp-caption-text">When clicked, the address bar changes into regular Windows folder path</p></div>
<p>This will then show the folder contents. From here, you can follow the path above until you get to the crash logs.</p>
<p>For Windows 7, follow the same procedure.</p>
<h3>Windows XP</h3>
<p>Location is here:</p>
<pre><code>C:\Documents and Settings\&lt;USERNAME&gt;\Application Data\Apple computer\Logs\CrashReporter/&lt;DEVICE_NAME&gt;</code></pre>
<p>&lt;USERNAME&gt; is your login username. <code>Application Data</code> folder is usually hidden by default, so you need to reveal it in the same way as in Vista — by typing in and pressing Enter.</p>
<p>And that’s it. Easy :) — rest is for developer to sweat it.</p>
]]></content:encoded>
			<wfw:commentRss>http://aplus.rs/apple/how-to-find-crash-logs-for-iphone-applications-on-mac-vista-and-xp/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Howto: find UDID of the iPhone or iPod Touch</title>
		<link>http://aplus.rs/apple/howto-find-udid-of-the-iphone-or-ipod-touch/</link>
		<comments>http://aplus.rs/apple/howto-find-udid-of-the-iphone-or-ipod-touch/#comments</comments>
		<pubDate>Fri, 29 May 2009 22:47:01 +0000</pubDate>
		<dc:creator>Aleksandar</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[beta testing]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[udid]]></category>

		<guid isPermaLink="false">http://aplus.rs/?p=466</guid>
		<description><![CDATA[How to find what is UDID of your iPhone or iPod Touch. Most likely required if you're gonna be beta testing iPhone apps.]]></description>
			<content:encoded><![CDATA[<p>Easiest way is to get it through iTunes.</p>
<p>On the main device screen, click on the serial number (the blured area below):<br />
<img class="alignnone size-full wp-image-467" title="iphone-serial" src="http://aplus.rs/wpa/wp-content/uploads/2009/05/iphone-serial.gif" alt="iphone-serial" width="396" height="150" /></p>
<p>When you click on it, it will change into this screen, which has the UDID:</p>
<p><img class="alignnone size-full wp-image-468" title="iphone-uuid" src="http://aplus.rs/wpa/wp-content/uploads/2009/05/iphone-uuid.gif" alt="iphone-uuid" width="568" height="150" /></p>
<p>Now do Cmd+C (Mac) or Ctrl+C (Win) — or use menu Edit/Copy — to get it into clipboard.</p>
<h3>Using existing iPhone apps</h3>
<p>If you have an iTunes Store account, get the free <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=285691333&amp;mt=8">Ad Hoc Helper</a> application. You need to have an email account setup so you can send the UDID to whom ever it’s needed.</p>
<p>The same thing can be done with <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=303034517&amp;mt=8">iStat</a> app, which is not free and it’s main purpose is not to get the UDID. But it does displays it and also allows you to send it over email.</p>
<h3>Using backups</h3>
<p>On Mac, iPhone backups are at:</p>
<pre>/Users/{USERNAME}/Library/Application Support/MobileSync/Backup/{UDID}</pre>
<p>On Windows Vista, iPhone backups are located at:</p>
<pre>C:\Users\{USERNAME}\AppData\Roaming\Apple Computer\MobileSync\Backup\{UDID}</pre>
<p>On Windows XP/2003 it’s:</p>
<pre>C:\Documents and Settings\{USERNAME}\Application Data\Apple Computer\MobileSync\Backup\{UDID}</pre>
<h3>Using iPhone Configuration Utility</h3>
<p>On the <a href="http://www.apple.com/support/iphone/enterprise/">iPhone Enterprise</a> page at Apple’s site, you can find links to Mac and Windows versions of this utility. One of the things it does is allows you to get the UDID.</p>
<p>Once you connect the device, this is the place to get it:</p>
<p><img class="alignnone size-full wp-image-469" title="iphone-config-util" src="http://aplus.rs/wpa/wp-content/uploads/2009/05/iphone-config-util.gif" alt="iphone-config-util" width="882" height="290" /></p>
<p>Now just select the identifier and copy into clipboard.</p>
]]></content:encoded>
			<wfw:commentRss>http://aplus.rs/apple/howto-find-udid-of-the-iphone-or-ipod-touch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Protected posts?</title>
		<link>http://aplus.rs/aplus/protected-posts/</link>
		<comments>http://aplus.rs/aplus/protected-posts/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 19:23:12 +0000</pubDate>
		<dc:creator>Aleksandar</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[aplus]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://aplus.rs/?p=413</guid>
		<description><![CDATA[As I’m baby stepping through the iPhone SDK development, I encounter some strange stuff. Given the unfortunate (to say the least) circumstance of the NDA still in place as of this writing, I can’t post publicly about it. I can’t ask on forums nor would anyone be allowed to answer. That’s how NDA stuff works.
In [...]]]></description>
			<content:encoded><![CDATA[<p>As I’m baby stepping through the iPhone SDK development, I encounter some strange stuff. Given the unfortunate (to say the least) circumstance of the NDA still in place as of this writing, I can’t post publicly about it. I can’t ask on forums nor would anyone be allowed to answer. That’s how NDA stuff works.</p>
<p>In order not to lose these stuff and to keep note of problem and solution (if I find one) for future benefit, I’m doing this password-protected posts that I will reveal once NDA is lifted.</p>
<p>Which hopefully will happen’ at some point.</p>
<p><strong>update:</strong> it did not take long — just days after I did this, Apple killed the NDA.</p>
]]></content:encoded>
			<wfw:commentRss>http://aplus.rs/aplus/protected-posts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Confusing stuff: NSLog and SystemSoundID</title>
		<link>http://aplus.rs/programming/confusing-stuff-nslog-and-systemsoundid/</link>
		<comments>http://aplus.rs/programming/confusing-stuff-nslog-and-systemsoundid/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 19:17:21 +0000</pubDate>
		<dc:creator>Aleksandar</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://aplus.rs/?p=409</guid>
		<description><![CDATA[SystemSoundID can really baffle newcomers into iPhone/Cocoa world.]]></description>
			<content:encoded><![CDATA[<p>In my first attemps with iPhone SDK programming — while working on Running Mate’s early proof of concepts — I tested the playing of short sound effects. That’s where I encountered this strange error:</p>
<pre>warning: Unable to read symbols for "/System/Library/Frameworks/UIKit.framework/UIKit" (file not found).
warning: Unable to read symbols from "UIKit" (not yet mapped into memory).</pre>
<p>As you can see, this error is entirely meaningless on its own — if this was true, none of apps would work. Which was not the case. This happened with 2.1 final SDK, where I last checked for this.</p>
<p>It turns out that problem was with this line:</p>
<div class="igBar"><span id="lc-8"><a href="#" onclick="javascript:showPlainTxt('c-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">C:</span>
<div id="c-8">
<pre class="c">
<ol>
<li style="color:#333;">
<div style="">NSLog<span style="color: #66cc66;">&#40;</span>@<span style="color: #ff0000;">"Play sound: %@"</span>, _soundID<span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</pre>
</div>
</div>
<p></p>
<p>where _<code>soundID</code> is of type <code>SystemSoundID</code>. Commenting this line out resolved the problem.</p>
<p>My guess here is that <code>SystemSoundID</code> does not have <code>description</code> properly implemented. <code>%@</code> should cover any object that accepts <code>description</code> message, so it’s not strange that a beginner would try to log it as given above. And would be mightily confused by the message in the console window, as I was.<br />
I got out of this by commenting out lines of code, one by one, starting from the last one I added.</p>
<p>Hopefully someone else will find this and saves oneself some time and nerves.</p>
]]></content:encoded>
			<wfw:commentRss>http://aplus.rs/programming/confusing-stuff-nslog-and-systemsoundid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to rename project in Xcode 3.x</title>
		<link>http://aplus.rs/programming/how-to-rename-project-in-xcode-3x/</link>
		<comments>http://aplus.rs/programming/how-to-rename-project-in-xcode-3x/#comments</comments>
		<pubDate>Sat, 02 Aug 2008 16:41:57 +0000</pubDate>
		<dc:creator>Aleksandar</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[cocoa]]></category>

		<guid isPermaLink="false">http://aplus.rs/?p=374</guid>
		<description><![CDATA[There is no simple way to rename a project. The name you originally used is inserted and hardcoded in several places, so it takes a bit of manual work to sort through.]]></description>
			<content:encoded><![CDATA[<p>I thought this would be a simple thing to do, but apparently not. There’s no option to copy the state of the project as it is and continue working on it under the new name. The reason I need this is that I’m going through AAron Hillegass’s <a href="http://www.amazon.co.uk/Cocoa-Programming-Mac-OS-X/dp/0321503619/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1217694919&amp;sr=8-1&amp;tag=aplusmoments-21&amp;linkCode=ur2&amp;camp=1634&amp;creative=6738">Cocoa Programming for Mac OS X, 3rd ed.</a> and some of the projects span several chapters, each introducing new concepts. Thus I wanted to have each in the state it was at the end of the chapter, than compare and analyze the differences, to better understand what’s new and improved.</p>
<p>Since no option, we go with manual work.</p>
<ol>
<li>Copy/rename the folder into new name</li>
<li>Get inside the new folder and rename the <code>.pch</code> and <code>.xcodeproj</code> files</li>
<li>Delete the build folder</li>
<li>Open <code>.xcodeproj</code> file in text editor, like TextMate or TextWrangler. That’s actually a folder, which contains 4 files (you can also right-click and do <code>Show package contents</code>, which will reveal the files)</li>
<li>Open project.pbxproj in text editor and replace all instances of the old name with the new name</li>
<li>Load the project file in XCode, do <code>Build</code>/<code>Clean all targets</code></li>
</ol>
<p>Now it should be ready for new build, under new name.</p>
]]></content:encoded>
			<wfw:commentRss>http://aplus.rs/programming/how-to-rename-project-in-xcode-3x/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)

Served from: aplus.rs @ 2010-09-10 03:09:44 -->