<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>le blog</title>
	
	<link>http://www.normyee.net/blog</link>
	<description />
	<lastBuildDate>Thu, 19 Aug 2010 18:49:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/normyee/blDs" /><feedburner:info uri="normyee/blds" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Updating iPhone apps to support Retina displays</title>
		<link>http://feedproxy.google.com/~r/normyee/blDs/~3/JWnfnnsiDvE/</link>
		<comments>http://www.normyee.net/blog/2010/08/19/updating-iphone-apps-to-support-retina-displays/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 18:49:12 +0000</pubDate>
		<dc:creator>norm</dc:creator>
				<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[retina display]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.normyee.net/blog/?p=198</guid>
		<description><![CDATA[The iPhone 4&#8242;s 640&#215;960 display is night and day better than the previous generation&#8217;s 320&#215;480 display. Supporting both is actually pretty straightforward.  The simplest thing is to do nothing: iOS 4 automagically up-sizes your image assets when running on a higher resolution display like the iPhone 4. It&#8217;ll look ok, but likely pixelated for the]]></description>
			<content:encoded><![CDATA[<p>The iPhone 4&#8242;s 640&#215;960 display is night and day better than the previous generation&#8217;s 320&#215;480 display. Supporting both is actually pretty straightforward.  The simplest thing is to do nothing: iOS 4 automagically up-sizes your image assets when running on a higher resolution display like the iPhone 4. It&#8217;ll look ok, but likely pixelated for the iPhone 4&#8242;s super sharp display.</p>
<p>To use higher res assets for iPhone 4, while keeping the lower res versions for earlier devices, simply add higher res images into your Xcode project with the following naming convention:</p>
<p style="padding-left: 30px;"><em>&lt;ImageName&gt;</em><strong><code>@2x</code></strong><code>.</code><em>&lt;filename_extension&gt;</em></p>
<p>If you have an existing image named <em>foobar.png</em> that is 100&#215;100, simply name the higher res 200&#215;200 version as <em>foobar@2x.png</em>, add it to your project, and re-build. You don&#8217;t need to do anything else&#8230;when that app runs on an iPhone 4, if there is a @2x version of an image, that version will be loaded instead.</p>
<p>This <a href="http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/SupportingResolutionIndependence/SupportingResolutionIndependence.html#//apple_ref/doc/uid/TP40007072-CH10" target="_blank">document on the Apple Developer site</a> summarizes it nicely &amp; goes into more detail than I&#8217;ve covered here.</p>
<img src="http://feeds.feedburner.com/~r/normyee/blDs/~4/JWnfnnsiDvE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.normyee.net/blog/2010/08/19/updating-iphone-apps-to-support-retina-displays/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.normyee.net/blog/2010/08/19/updating-iphone-apps-to-support-retina-displays/</feedburner:origLink></item>
		<item>
		<title>Resizing UILabel inside a UITable cell when doing a swipe delete gesture</title>
		<link>http://feedproxy.google.com/~r/normyee/blDs/~3/M96y5JQL1Ac/</link>
		<comments>http://www.normyee.net/blog/2010/08/13/resizing-uilabel-inside-a-uitable-cell-when-doing-a-swipe-delete-gesture/#comments</comments>
		<pubDate>Fri, 13 Aug 2010 20:31:04 +0000</pubDate>
		<dc:creator>norm</dc:creator>
				<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[objective-c]]></category>

		<guid isPermaLink="false">http://www.normyee.net/blog/?p=182</guid>
		<description><![CDATA[When you do a right swipe gesture on a table cell in the iPhone&#8217;s Mail app, a delete button appears and the text reflows around the button, like so: I built a similar interface that looks and functions similarly. The only problem was that when you right swiped, the delete button would appear, but the]]></description>
			<content:encoded><![CDATA[<p>When you do a right swipe gesture on a table cell in the iPhone&#8217;s Mail app, a delete button appears and the text reflows around the button, like so:</p>

<a href="http://www.normyee.net/blog/wp-content/gallery/iphone/swipedelete.png" title="" class="thickbox" rel="singlepic55" >
	<img class="ngg-singlepic ngg-center" src="http://www.normyee.net/blog/index.php?callback=image&amp;pid=55&amp;width=505&amp;height=171&amp;mode=" alt="swipedelete" title="swipedelete" />
</a>

<p>I built a similar interface that looks and functions similarly. The only problem was that when you right swiped, the delete button would appear, but the text <strong><em>would not</em></strong> reflow. Looking at the API docs, I made sure that all the subviews were added to the <a href="http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UITableViewCell_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006938-CH3-SW18" target="_blank">UITableViewCell&#8217;s contentView</a>. I found a post on Stack Overflow that mentioned setting the <a href="http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIView_Class/UIView/UIView.html#//apple_ref/doc/uid/TP40006816-CH3-SW99" target="_blank">contentMode</a> property to <a href="http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIView_Class/UIView/UIView.html#//apple_ref/doc/c_ref/UIViewContentModeLeft" target="_blank">UIViewContentModeLeft</a>, but that didn&#8217;t work for me.</p>
<p>After digging around some more, I discovered that the <a href="http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIView_Class/UIView/UIView.html#//apple_ref/doc/uid/TP40006816-CH3-SW6" target="_blank">autoresizingMask property of UILabel</a> defaults to <a href="http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIView_Class/UIView/UIView.html#//apple_ref/c/econst/UIViewAutoresizingNone" target="_blank">UIViewAutoresizingNone</a>. When i set autoresizingMask to <a href="http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIView_Class/UIView/UIView.html#//apple_ref/doc/c_ref/UIViewAutoresizingFlexibleWidth" target="_blank">UIViewAutoresizingFlexibleWidth</a> in the two UILabels (subject &amp; body preview), they now reflow automatically when the delete button appears.</p>
<img src="http://feeds.feedburner.com/~r/normyee/blDs/~4/M96y5JQL1Ac" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.normyee.net/blog/2010/08/13/resizing-uilabel-inside-a-uitable-cell-when-doing-a-swipe-delete-gesture/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.normyee.net/blog/2010/08/13/resizing-uilabel-inside-a-uitable-cell-when-doing-a-swipe-delete-gesture/</feedburner:origLink></item>
		<item>
		<title>Adding random contacts and email addresses to the iPhone simulator address book</title>
		<link>http://feedproxy.google.com/~r/normyee/blDs/~3/RVyMiniuhHo/</link>
		<comments>http://www.normyee.net/blog/2010/08/04/adding-random-contacts-and-email-addresses-to-the-iphone-simulator-address-book/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 18:12:19 +0000</pubDate>
		<dc:creator>norm</dc:creator>
				<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[objective-c]]></category>

		<guid isPermaLink="false">http://www.normyee.net/blog/?p=172</guid>
		<description><![CDATA[I needed some test data in my iPhone simulator&#8217;s address book to test out some functionality in the Raptr iPhone app, but adding contacts one by one would have been onerous, especially since I wanted several hundred! Thankfully, you can programmatically add contacts to the iPhone contacts so I came up with the following snippet for a]]></description>
			<content:encoded><![CDATA[<p>I needed some test data in my iPhone simulator&#8217;s address book to test out some functionality in the Raptr iPhone app, but adding contacts one by one would have been onerous, especially since I wanted several hundred!</p>
<p>Thankfully, you can programmatically add contacts to the iPhone contacts so I came up with the following snippet for a quick and dirty way to add a bunch of random contacts with random email addresses:</p>
<pre class="brush: objc;">
ABAddressBookRef addressBook = ABAddressBookCreate();

// create 200 random contacts
for (int i = 0; i &lt; 200; i++)
{
	// create an ABRecordRef
	ABRecordRef record = ABPersonCreate();

	ABMutableMultiValueRef multi = ABMultiValueCreateMutable(kABStringPropertyType);

	NSString *email = [NSString stringWithFormat:@&quot;%i@%ifoo.com&quot;, i, i];
	ABMultiValueAddValueAndLabel(multi, email, kABHomeLabel, NULL);

	NSString *fname = [NSString stringWithFormat:@&quot;Name %i&quot;, i];
	NSString *lname = [NSString stringWithFormat:@&quot;Last %i&quot;, i];

	// add the first name
	ABRecordSetValue(record, kABPersonFirstNameProperty, fname, NULL);

	// add the last name
	ABRecordSetValue(record, kABPersonLastNameProperty, lname, NULL);

	// add the home email
	ABRecordSetValue(record, kABPersonEmailProperty, multi, NULL);

	// add the record
	ABAddressBookAddRecord(addressBook, record, NULL);
}

// save the address book
ABAddressBookSave(addressBook, NULL);

// release
CFRelease(addressBook);
</pre>
<p>Put this inside -viewDidLoad or -loadView, launch the simulator and you&#8217;re set: 200 random contacts added to the simulator&#8217;s Contacts app. Make sure you remove this code snippet after you&#8217;ve run it once or you&#8217;ll keep adding random contacts. If you ever want to clear out the contacts on the simulator just go to the menu: iPhone Simulator -> Reset Content and Settings&#8230; </p>
<img src="http://feeds.feedburner.com/~r/normyee/blDs/~4/RVyMiniuhHo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.normyee.net/blog/2010/08/04/adding-random-contacts-and-email-addresses-to-the-iphone-simulator-address-book/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.normyee.net/blog/2010/08/04/adding-random-contacts-and-email-addresses-to-the-iphone-simulator-address-book/</feedburner:origLink></item>
		<item>
		<title>Downloading earlier versions of iPhone OS</title>
		<link>http://feedproxy.google.com/~r/normyee/blDs/~3/r1STeRfACAA/</link>
		<comments>http://www.normyee.net/blog/2010/07/30/downloading-earlier-versions-of-iphone-os/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 16:54:22 +0000</pubDate>
		<dc:creator>norm</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[downgrade]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://www.normyee.net/blog/?p=169</guid>
		<description><![CDATA[If you&#8217;re ever in need of downloading an earlier version on the iPhone OS, iClarified has a list of iPhone firmware files for download from Apple&#8217;s servers. This is great if say you need to downgrade your iPhone 3G from iOS 4 back to iOS 3.1.3.]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re ever in need of downloading an earlier version on the iPhone OS, iClarified has a <a href="http://www.iclarified.com/entry/index.php?enid=750" target="_blank">list of iPhone firmware files</a> for download from Apple&#8217;s servers. This is great if say you need to <a href="http://lifehacker.com/5572003/how-to-downgrade-your-iphone-3g%5Bs%5D-from-ios-4-to-ios-313" target="_blank">downgrade your iPhone 3G from iOS 4 back to iOS 3.1.3</a>.</p>
<img src="http://feeds.feedburner.com/~r/normyee/blDs/~4/r1STeRfACAA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.normyee.net/blog/2010/07/30/downloading-earlier-versions-of-iphone-os/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.normyee.net/blog/2010/07/30/downloading-earlier-versions-of-iphone-os/</feedburner:origLink></item>
		<item>
		<title>Grain of sand: 0, Canon SD800 IS: 1</title>
		<link>http://feedproxy.google.com/~r/normyee/blDs/~3/3w2GePG1U1c/</link>
		<comments>http://www.normyee.net/blog/2009/12/09/grain-of-sand-0-canon-sd800-is-1/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 21:51:40 +0000</pubDate>
		<dc:creator>norm</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[canon]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[macgyver]]></category>

		<guid isPermaLink="false">http://www.normyee.net/blog/?p=113</guid>
		<description><![CDATA[Our trusty Canon PowerShot SD800 IS locked up the other day in the lens open position and whenever it powered up a &#8220;Lens error, restart camera&#8221; error message appeared on the LCD screen and the camera would then shut off. Ends up that there was a single grain of sand that was stuck in between]]></description>
			<content:encoded><![CDATA[<p>Our trusty <a href="http://www.usa.canon.com/consumer/controller?act=ModelInfoAct&amp;fcategoryid=145&amp;modelid=14227" target="_blank">Canon PowerShot SD800 IS</a> locked up the other day in the lens open position and whenever it powered up a &#8220;Lens error, restart camera&#8221; error message appeared on the LCD screen and the camera would then shut off.</p>
<p>Ends up that there was a <em>single grain of sand</em> that was stuck in between the gears that open/retract the lens. The cover is secured by a few tiny screws so it&#8217;s actually pretty easy to open up. Once I got the little bugger out from in between the gears (simply by manually turning the gears by hand), I fired up the camera again and the lens started working again!</p>
<p>Here are some disassembly pics, with the gears that control the opening/retracting of the lens circled in yellow.<br />

<div class="ngg-galleryoverview" id="ngg-gallery-25-113">


	
	<!-- Thumbnails -->
		
	<div id="ngg-image-53" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.normyee.net/blog/wp-content/gallery/canon-sd800-repair/gx4a4349.jpg" title="The front cover of the camera removed" class="thickbox" rel="set_25" >
								<img title="Canon SD800 IS" alt="Canon SD800 IS" src="http://www.normyee.net/blog/wp-content/gallery/canon-sd800-repair/thumbs/thumbs_gx4a4349.jpg" width="100" height="100" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-54" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.normyee.net/blog/wp-content/gallery/canon-sd800-repair/gx4a4357.jpg" title="Close-up of the gears" class="thickbox" rel="set_25" >
								<img title="Canon SD800 IS" alt="Canon SD800 IS" src="http://www.normyee.net/blog/wp-content/gallery/canon-sd800-repair/thumbs/thumbs_gx4a4357.jpg" width="100" height="100" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-52" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.normyee.net/blog/wp-content/gallery/canon-sd800-repair/gx4a4346.jpg" title="Close-up of the gears" class="thickbox" rel="set_25" >
								<img title="Canon SD800 IS" alt="Canon SD800 IS" src="http://www.normyee.net/blog/wp-content/gallery/canon-sd800-repair/thumbs/thumbs_gx4a4346.jpg" width="100" height="100" />
							</a>
		</div>
	</div>
	
		
 	 	
	<!-- Pagination -->
 	<div class='ngg-clear'></div>
 	
</div>

</p>
<img src="http://feeds.feedburner.com/~r/normyee/blDs/~4/3w2GePG1U1c" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.normyee.net/blog/2009/12/09/grain-of-sand-0-canon-sd800-is-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.normyee.net/blog/2009/12/09/grain-of-sand-0-canon-sd800-is-1/</feedburner:origLink></item>
	</channel>
</rss>
