<?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>SteveX Compiled &#187; Apple</title>
	<atom:link href="http://blog.stevex.net/category/apple/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.stevex.net</link>
	<description>Software development and other notes.</description>
	<lastBuildDate>Tue, 07 Feb 2012 19:52:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Thoughts on the Mute Switch</title>
		<link>http://blog.stevex.net/2012/01/thoughts-on-the-mute-switch/</link>
		<comments>http://blog.stevex.net/2012/01/thoughts-on-the-mute-switch/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 00:34:26 +0000</pubDate>
		<dc:creator>stevex</dc:creator>
				<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://blog.stevex.net/?p=1971</guid>
		<description><![CDATA[So there&#8217;s been some blog chatter this week about the mute switch on the iPhone. Of course it&#8217;s not really called a mute switch, and it doesn&#8217;t really &#8220;mute&#8221; the phone. It&#8217;s really just a signal to the OS that the user would like less sounds. I fall firmly on the &#8220;the mute switch should [...]]]></description>
			<content:encoded><![CDATA[<p>So there&#8217;s been some blog chatter this week about the mute switch on the iPhone.  Of course it&#8217;s not really called a mute switch, and it doesn&#8217;t really &#8220;mute&#8221; the phone.  It&#8217;s really just a signal to the OS that the user would like less sounds.</p>
<p>I fall firmly on the &#8220;the mute switch should really mute the phone&#8221; side of the fence, at least optionally.</p>
<p>If I&#8217;m in a location where I&#8217;m expecting my phone to be silent out of respect for something (like, in a movie, at a live performance, or at a funeral) then even if I have an alarm configured for that time, I don&#8217;t want it to go off.  It&#8217;s going to embarrass me if it goes off.  And yes, I even include the &#8220;Find My iPhone&#8221; sound in the list of sounds I don&#8217;t want my phone playing in these situations.  There are some times when I want to know that my muted phone really isn&#8217;t going to make a sound.</p>
<p>But the difference is I don&#8217;t expect the phone to stay that way.  </p>
<p><a href="http://daringfireball.net">John Gruber</a> <a href="http://5by5.tv/talkshow/75">mentioned</a> that when he mutes his phone while in a movie, he almost never remembers to unmute it.  That&#8217;s a common problem, but it&#8217;s not a hard one to solve.  </p>
<p>There was a feature on an old phone I had, that would let you mute the phone for a period of time.  &#8220;Mute for 2 hours&#8221;, for example.  When you think about it, mute is almost always situational.  You want your phone muted for a while, and usually you know how long.  This would do away with the problem of &#8220;I muted my phone for a movie but then I missed my alarm clock the next morning because my phone was still muted&#8221;.</p>
<p>Better yet, make the phone muting part of a meeting setting.  When I put the appointment in my calendar to go to a movie for 2 hours on Thursday, I&#8217;d like to set the phone to mute right there.  That way there&#8217;s no chance I&#8217;ll forget to mute it, and no chance I&#8217;ll forget to unmute it.</p>
<p>This seems like an obvious feature but I&#8217;ve never seen any phone support it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stevex.net/2012/01/thoughts-on-the-mute-switch/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>My iTunes Match Experience</title>
		<link>http://blog.stevex.net/2011/12/my-itunes-match-experience/</link>
		<comments>http://blog.stevex.net/2011/12/my-itunes-match-experience/#comments</comments>
		<pubDate>Fri, 16 Dec 2011 22:16:49 +0000</pubDate>
		<dc:creator>stevex</dc:creator>
				<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://blog.stevex.net/?p=1949</guid>
		<description><![CDATA[I&#8217;m in the middle of setting up with iTunes Match. So far, it&#8217;s been anything but smooth. First off, I signed up during the brief window when iTunes Match was available for sale but not actually working in Canada, so I had a completely broken service for a day or so. But once it was [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m in the middle of setting up with iTunes Match.  So far, it&#8217;s been anything but smooth.</p>
<p>First off, I signed up during the brief window when iTunes Match was available for sale but not actually working in Canada, so I had a completely broken service for a day or so. </p>
<p>But once it was officially switched on, it started working.  There are 3 steps to iTunes Match:</p>
<p><img src="http://blog.stevex.net/files/2011/12/201112161716.jpg" height="99" width="534" border="1" hspace="4" vspace="4" alt="201112161716" /></p>
<p>Step 1 was painless.  It whipped through my ~23k songs in an hour or so, and then went on to step 2.  I left it at step 2 overnight, and when I woke up in the morning, it was stuck.  It was about 80% done, but not moving. </p>
<p>I stopped iTunes Match and restarted it, and this time paid attention to where it stopped.  This time it made it to song #22548, and then hung.  Stopped, restarted, and it made it to 22549.  Progress, but the 10 minutes or so it took for every attempt to make it to that song number was painful.  I was watching with fs_usage to see if it was getting hung up on a certain album or something, but every time it stopped it was on something completely different.</p>
<p>But after 2 more restarts, it made it all the way through my music library.  Now it&#8217;s on Step 3, uploading, and and with 4103 items to go, this one&#8217;s going to take a while.</p>
<p>The message I wanted to convey in this post is:  If iTunes Match is hanging during Step 2, just stop it and restart it.  Eventually it will complete.</p>
<p><em>Update</em> three days later:  It&#8217;s just over half done.  About 1950 songs to go.  I&#8217;m on DSL, so my upstream bandwidth is about 1 megabit.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stevex.net/2011/12/my-itunes-match-experience/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iTunes Match Canada Rollout</title>
		<link>http://blog.stevex.net/2011/12/itunes-match-canada-rollout/</link>
		<comments>http://blog.stevex.net/2011/12/itunes-match-canada-rollout/#comments</comments>
		<pubDate>Thu, 15 Dec 2011 11:32:56 +0000</pubDate>
		<dc:creator>stevex</dc:creator>
				<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://blog.stevex.net/?p=1943</guid>
		<description><![CDATA[Or not-rollout as the case may be. Last night I read that iTunes Match had been switched on in Canada, so I fired up iTunes and went to my account page, and there was an option to Learn More about iTunes Match. I clicked on that and it let me sign up. But after that [...]]]></description>
			<content:encoded><![CDATA[<p>Or not-rollout as the case may be.  Last night I read that iTunes Match had been switched on in Canada, so I fired up iTunes and went to my account page, and there was an option to Learn More about iTunes Match.  I clicked on that and it let me sign up.</p>
<p>But after that .. nothing.  No new UI to let me sync my songs to the cloud.  </p>
<p>Either this is was a mistaken rollout and they&#8217;ve switched it off (in which case they&#8217;ve got a lot of refunding to do) or they are having problems with all the extra subscribers and the problem will sort itself out shortly.</p>
<p>I&#8217;m thinking it was a mistaken rollout.  Why?  Because check this out:</p>
<p><img src="http://blog.stevex.net/files/2011/12/201112150633.jpg"/></p>
<p>It would be so out of character for Apple to ship UI with a typo.  I&#8217;m guessing this was supposed to be some sort of test release that accidentally got pushed live.</p>
<p><b>Update</b>: It&#8217;s really live now, and working for me.  Typo and all.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stevex.net/2011/12/itunes-match-canada-rollout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reinstalling Xcode</title>
		<link>http://blog.stevex.net/2011/12/reinstalling-xcode/</link>
		<comments>http://blog.stevex.net/2011/12/reinstalling-xcode/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 16:38:18 +0000</pubDate>
		<dc:creator>stevex</dc:creator>
				<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://blog.stevex.net/2011/12/reinstalling-xcode/</guid>
		<description><![CDATA[I ran into a problem with my Xcode install. I had actually just dragged it over from another volume, and this seemed to work, but I was having some trouble running Instruments, so I decided I&#8217;d just reinstall it. I uninstalled Xcode, went to redownload it, but the Mac App Store still said it was [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into a problem with my Xcode install.  I had actually just dragged it over from another volume, and this seemed to work, but I was having some trouble running Instruments, so I decided I&#8217;d just reinstall it.  I <a href="http://macdevelopertips.com/xcode/how-to-uninstall-xcode.html">uninstalled Xcode</a>, went to redownload it, but the Mac App Store still said it was installed.</p>
<p>Hmm.  Now what?  There is no direct download link for Xcode; the only way to get it is through the store.</p>
<p>When you get Xcode through the Mac App Store, what you actually get is an app called &#8220;Install Xcode&#8221;.</p>
<p><img src="http://blog.stevex.net/files/2011/12/201112121135.jpg"></img></p>
<p>You run this app and it installs Xcode.  It leaves itself in your /Applications folder, and it&#8217;s this app that has the Mac App Store receipt file identifying it as an app that&#8217;s installed, so normally all you need to do is get rid of this &#8220;Install Xcode&#8221; application for the store to stop seeing Xcode as installed.</p>
<p>But this didn&#8217;t work for me.  I removed the installer, went back to the store, and it still wouldn&#8217;t let me download.</p>
<p><img src="http://blog.stevex.net/files/2011/12/201112121136.jpg"></img></p>
<p>To figure out how the App Store was finding Xcode installed, I used the fs_usage tool:</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><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">sudo fs_usage &gt;~/out.txt</div></td></tr></tbody></table></div>
<p>Run this in Terminal before starting the App Store.  This command will log all file system activity to a file named &#8216;out.txt&#8217; in your home folder.  With it running, launch the App Store.  Then, back in the console, hit Ctrl-C to stop fs_usage, and open the out.txt file in an editor. Search for the string &#8220;Xcode&#8221;, and you should see some lines like this:</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><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 />2<br />3<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">10:04:36 &nbsp;lstat64 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /Volumes/Steve's Laptop Backup/Applications/Install Xcode.app &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0.000033 &nbsp; App Store &nbsp; <br />
10:04:36 &nbsp;getattrlist &nbsp; &nbsp; &nbsp; /Volumes/Steve's Laptop Backup/Applications/Install Xcode.app &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0.000006 &nbsp; App Store &nbsp; <br />
10:04:36 &nbsp;getattrlist &nbsp; &nbsp; &nbsp; /Volumes/Steve's Laptop Backup/Applications/Install Xcode.app &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0.000009 &nbsp; App Store</div></td></tr></tbody></table></div>
<p>Aha!  I had a drive mounted that had an old Applications folder, where the installer was already downloaded.  I have no idea how I would have found this otherwise.</p>
<p>(I had tried searching for the Xcode installer using Spotlight but I had told Spotlight not to index that backup drive, so it didn&#8217;t find it).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stevex.net/2011/12/reinstalling-xcode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building a Dynamic UIActionSheet</title>
		<link>http://blog.stevex.net/2011/12/building-a-dynamic-uiactionsheet/</link>
		<comments>http://blog.stevex.net/2011/12/building-a-dynamic-uiactionsheet/#comments</comments>
		<pubDate>Sat, 03 Dec 2011 16:37:56 +0000</pubDate>
		<dc:creator>stevex</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://blog.stevex.net/?p=1923</guid>
		<description><![CDATA[Most of the examples I see for UIActionSheet (the iOS pop-up menu) show static choices and checking for which one was picked by using constant values. That&#8217;s not going to work if your menu needs to be dynamic. For example, if you want to have an option to Email or Print an item, you might [...]]]></description>
			<content:encoded><![CDATA[<p>Most of the examples I see for UIActionSheet (the iOS pop-up menu) show static choices and checking for which one was picked by using constant values.  That&#8217;s not going to work if your menu needs to be dynamic.</p>
<p>For example, if you want to have an option to Email or Print an item, you might want this on a UIActionSheet menu.  But if either of these things aren&#8217;t available (for example, you may be running on a device that doesn&#8217;t support printing, or there may not be an email account configured) then you shouldn&#8217;t show these items. </p>
<p>Here&#8217;s one way to do this.</p>
<p>Start out by creating localized string variables for the menu items.</p>
<div class="codecolorer-container objc dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><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 />2<br />3<br />4<br /></div></td><td><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span style="color: #400080;">NSString</span></a> <span style="color: #002200;">*</span>MPActionMenuCancelItem <span style="color: #002200;">=</span> NSLocalizedString<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Cancel&quot;</span>, <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Cancel item in Action Sheet&quot;</span><span style="color: #002200;">&#41;</span>;<br />
<a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span style="color: #400080;">NSString</span></a> <span style="color: #002200;">*</span>MPActionMenuDeleteItem <span style="color: #002200;">=</span> NSLocalizedString<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Delete&quot;</span>, <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Delete item in Action Sheet&quot;</span><span style="color: #002200;">&#41;</span>;<br />
<a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span style="color: #400080;">NSString</span></a> <span style="color: #002200;">*</span>MPActionMenuEmailItem <span style="color: #002200;">=</span> NSLocalizedString<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Email&quot;</span>, <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Email item in Action Sheet&quot;</span><span style="color: #002200;">&#41;</span>;<br />
<a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span style="color: #400080;">NSString</span></a> <span style="color: #002200;">*</span>MPActionMenuPrintItem <span style="color: #002200;">=</span> NSLocalizedString<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Print&quot;</span>, <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Print item in Action Sheet&quot;</span><span style="color: #002200;">&#41;</span>;</div></td></tr></tbody></table></div>
<p>Note that I&#8217;m using NSLocalizedString here and not simply using a string value.</p>
<p>Now you need to dynamically build the UIActionSheet.  Here&#8217;s code to do that:</p>
<div class="codecolorer-container objc dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><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 />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br /></div></td><td><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>IBAction<span style="color: #002200;">&#41;</span>actionSelected<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span>sender <br />
<span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; UIActionSheet <span style="color: #002200;">*</span>actions <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIActionSheet alloc<span style="color: #002200;">&#93;</span> initWithTitle<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;delegate<span style="color: #002200;">:</span>self <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cancelButtonTitle<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;destructiveButtonTitle<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; otherButtonTitles<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span>MFMailComposeViewController canSendMail<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #002200;">&#91;</span>actions addButtonWithTitle<span style="color: #002200;">:</span>MPActionMenuEmailItem<span style="color: #002200;">&#93;</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span>UIPrintInteractionController canPrintURL<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/"><span style="color: #400080;">NSURL</span></a> fileURLWithPath<span style="color: #002200;">:</span>imageData.path<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #002200;">&#91;</span>actions addButtonWithTitle<span style="color: #002200;">:</span>MPActionMenuPrintItem<span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; actions.destructiveButtonIndex <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>actions addButtonWithTitle<span style="color: #002200;">:</span>MPActionMenuDeleteItem<span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; actions.cancelButtonIndex <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>actions addButtonWithTitle<span style="color: #002200;">:</span>MPActionMenuCancelItem<span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #002200;">&#91;</span>actions showFromBarButtonItem<span style="color: #002200;">:</span>sender animated<span style="color: #002200;">:</span><span style="color: #a61390;">YES</span><span style="color: #002200;">&#93;</span>;<br />
<span style="color: #002200;">&#125;</span></div></td></tr></tbody></table></div>
<p>Notice how email and printing are only included if supported.  </p>
<p>It&#8217;s convenient that addButtonWithTitle: returns the button index that was added, so we can assign the button indexes for those directly.  </p>
<p>When the user picks an item from the UIActionSheet, we need to figure out what they picked and act on it.</p>
<div class="codecolorer-container objc dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:600px;"><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 />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br /></div></td><td><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>actionSheet<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UIActionSheet <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>actionSheet clickedButtonAtIndex<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>NSInteger<span style="color: #002200;">&#41;</span>buttonIndex<br />
<span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>buttonIndex <span style="color: #002200;">==</span> actionSheet.cancelButtonIndex<span style="color: #002200;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a61390;">return</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>buttonIndex <span style="color: #002200;">==</span> actionSheet.destructiveButtonIndex<span style="color: #002200;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #002200;">&#91;</span>self deleteItem<span style="color: #002200;">&#93;</span>;<br />
&nbsp;<br />
&nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span style="color: #400080;">NSString</span></a> <span style="color: #002200;">*</span>clicked <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>actionSheet buttonTitleAtIndex<span style="color: #002200;">:</span>buttonIndex<span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span>clicked compare<span style="color: #002200;">:</span>MPActionMenuEmailtem<span style="color: #002200;">&#93;</span> <span style="color: #002200;">==</span> NSOrderedSame<span style="color: #002200;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #002200;">&#91;</span>self emailItem<span style="color: #002200;">&#93;</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span>clicked compare<span style="color: #002200;">:</span>MPActionMenuPrintItem<span style="color: #002200;">&#93;</span> <span style="color: #002200;">==</span> NSOrderedSame<span style="color: #002200;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #002200;">&#91;</span>self printItem<span style="color: #002200;">&#93;</span>;<br />
<span style="color: #002200;">&#125;</span></div></td></tr></tbody></table></div>
<p>I thought about building a table of indices to action values or something more complex like that, because comparing the selected string somehow just doesn&#8217;t feel right.  That may be my years as a Windows developer showing through, because this way is straightforward, and works great.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stevex.net/2011/12/building-a-dynamic-uiactionsheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Siri on iPad and iPhone 4</title>
		<link>http://blog.stevex.net/2011/11/siri-on-ipad-and-iphone-4/</link>
		<comments>http://blog.stevex.net/2011/11/siri-on-ipad-and-iphone-4/#comments</comments>
		<pubDate>Wed, 23 Nov 2011 17:25:00 +0000</pubDate>
		<dc:creator>stevex</dc:creator>
				<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://blog.stevex.net/?p=1902</guid>
		<description><![CDATA[There&#8217;s a question that&#8217;s been asked: Why isn&#8217;t Siri available on other iOS 5 devices? Answers have varied, but a common one seems to be that it&#8217;s an attempt to engage in a scaled rollout. Turning Siri on for anyone with an iOS 5 compatible device would have resulted in much greater load on the [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a question that&#8217;s been asked:  Why isn&#8217;t Siri available on other iOS 5 devices?</p>
<p>Answers have varied, but a common one seems to be that it&#8217;s an attempt to engage in a scaled rollout.  Turning Siri on for anyone with an iOS 5 compatible device would have resulted in much greater load on the servers, and so, the theory goes, Apple used the hardware as a gatekeeper.  Not a bad theory.</p>
<p>Another theory is simply that they wanted to give people a reason to upgrade.  I don&#8217;t give this theory as much credit, since I don&#8217;t think that&#8217;s how Apple works.  Apple has been providing new features to existing phones since the first iPhone updates.  Apple wants to keep you happy with your iPhone, so you keep buying apps, and when the time comes, make your next phone an iPhone as well.</p>
<p>My theory is a bit different.</p>
<p>I think Apple may not be making Siri available to customers of older phones because they didn&#8217;t pay for it.</p>
<p>Revenue recognition rules are a funny thing.  They prevent companies from adding features to existing products, because the users of those existing products didn&#8217;t pay for them.  Remember when Apple had to charge a small fee for a WiFi driver update that added 802.11N to MacBook Pro&#8217;s that had the hardware but didn&#8217;t come with drivers?  They didn&#8217;t do that because they wanted to, they did that because the accounting rules forced them to.</p>
<p>Siri is &#8220;in beta&#8221; now, and I think the reason it&#8217;s labelled as such is because it sets the expectation that the feature isn&#8217;t done; that there will be updates to it that are included in the price you&#8217;re paying for the hardware, even though those features aren&#8217;t done yet.  It makes it easier for Apple to add features without getting into accounting trouble.</p>
<p>So, could Apple make Siri available for existing devices, the way it did with that network driver?  Yes, it could.  And I&#8217;m guessing that once the initial rush on the servers is done, and once the software is a little farther along, they may do just that.  </p>
<p>Would you pay $4.99 to add Siri to your existing phone?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stevex.net/2011/11/siri-on-ipad-and-iphone-4/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Thoughts on Steve Jobs</title>
		<link>http://blog.stevex.net/2011/11/thoughts-on-steve-jobs/</link>
		<comments>http://blog.stevex.net/2011/11/thoughts-on-steve-jobs/#comments</comments>
		<pubDate>Fri, 04 Nov 2011 14:03:01 +0000</pubDate>
		<dc:creator>stevex</dc:creator>
				<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://blog.stevex.net/?p=1887</guid>
		<description><![CDATA[I finished reading Jobs’s bio this morning. It’s a fascinating read, and I recommend it to anyone who knows who he is. This post will be mostly spoiler-free; I’m not going to talk about specific things from the bio, but rather his management, and Apple. But it will probably make more sense if you’ve read [...]]]></description>
			<content:encoded><![CDATA[<p>I finished reading Jobs’s bio this morning.  It’s a fascinating read, and I recommend it to anyone who knows who he is.  </p>
<p>This post will be mostly spoiler-free; I’m not going to talk about specific things from the bio, but rather his management, and Apple.  But it will probably make more sense if you’ve read the book.</p>
<p>I’m not sure it’s a great biography.  I don’t feel like I really got to know Steve Jobs the way you typically do in a good biography.  Some of that is, I’m sure, because the book is big enough already and there’s not much in there that you could leave out.  But it’s also probably because it was hard to really get to know him.</p>
<p>Jobs was strong-willed, had a serious perfectionist streak, and could be very charismatic and influential.  He had a strong desire for things to be well-designed, and as simple as they could possibly be.  This showed in every product he was involved in.</p>
<p>But, and here we go into my thoughts, he was only able to achieve these things because of the opportunity that Steve Wozniak gave him.</p>
<p>Jobs was, as the book (and even Jobs himself) repeatedly asserts, an asshole.  I doubt he’d do well in a job interview, or with people who didn’t already respect him for his past accomplishments.  But he proved, with the Apple I and II, that he could build ship products.</p>
<p>Shipping great products is different from designing great products.  Woz came up with the hardware for the early Apple computers, but he wanted to give the designs away.  It was Jobs who valued the work they’d done and had the vision for building a company around it.  It was Jobs who obsessed over the marketing and presentation but it was also Jobs who set requirements on what the hardware had to do, what it should look like, and other facets that fed back into engineering. He wasn’t just a sales guy.</p>
<p>Jobs needed a good team behind him to ship the products that he did.</p>
<p>He had to build the team himself, and to do that, he basically needed to already be rich and buy a great team (Pixar), or needed someone like Woz, to build the product and then partner with him.  Their early meeting and collaboration is what facilitated the creation of Apple and gave Jobs the team he needed to build the products he did.</p>
<p>It comes up frequently in the book how Jobs had to wrestle with teams to get them to do what they wanted.  He needed something to be a certain way, for reasons that mattered deeply to him but that others viewed as unimportant.  Through sheer force of will he got things done the way they needed to get done.</p>
<p>Tim Cook is a brilliant operations guy.  He knows how to make things that work, ship them on time, and ship millions of them.  But, as even Jobs admits, he’s not a product guy.</p>
<p>Apple is a machine that can build almost anything.  Ideas either come from the top, or bubble up to the top, where the the vision is defined.  Tim Cook and the rest of the team can execute that vision, but now they don’t (seem to) have anyone to champion and nurture and refine that vision.</p>
<p>Jony Ive would probably jump up and down here and rightly so.  But I don’t think you want an artist driving vision either.  That’s when you get products like the iPod Hi-Fi that are beautiful products that don’t fit with what people want.  </p>
<p>Jobs and Wozniak was the perfect starting combination.  Jobs with Tim Cook running the show is a scaled up version of that, an unstoppable innovation machine.</p>
<p>I wanted to speculate here about the prospects for Apple without Jobs are, but that&#8217;s hard to do.  I&#8217;m sure there are a few years worth of grand ideas in the pipeline, but as Jobs showed, it&#8217;s about the details.  Jobs built a company that can make great products, but for as long as he could he was deeply involved in the tiniest details.</p>
<p>But here&#8217;s an encouraging thought.  Siri, the voice assistant in the iPhone 4S, was done, from the sounds of it, mostly without Jobs&#8217;s involvement.  Siri represents some of the most interesting UI innovation on the iPhone in the last few years.  Completely new stuff, and in my opinion, beautifully designed, with an excellent attention to the details.  </p>
<p>The fact that this was done without Jobs gives me hope that Jobs really has created a company that can build the products he might have built, without him.  Let&#8217;s hope so.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stevex.net/2011/11/thoughts-on-steve-jobs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fragmentation on Mac OS X: Time for a Change</title>
		<link>http://blog.stevex.net/2010/10/fragmentation-on-mac-os-x-time-for-a-change/</link>
		<comments>http://blog.stevex.net/2010/10/fragmentation-on-mac-os-x-time-for-a-change/#comments</comments>
		<pubDate>Sat, 02 Oct 2010 12:59:20 +0000</pubDate>
		<dc:creator>stevex</dc:creator>
				<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://blog.stevex.net/?p=1739</guid>
		<description><![CDATA[Windows systems suffer from file system fragmentation and benefit from defragmentation. Windows 7 includes a defragmenter (as did previous versions of Windows) and automatically defragment the file system from time to time. The Mac takes a different approach. There are quite a few mechanisms built into the HFS+ file system to keep the system working [...]]]></description>
			<content:encoded><![CDATA[<p>Windows systems suffer from file system fragmentation and benefit from defragmentation.  Windows 7 includes a defragmenter (as did previous versions of Windows) and automatically defragment the file system from time to time.</p>
<p>The Mac takes a different approach.  There are quite a few mechanisms built into the HFS+ file system to keep the system working smoothly (check out <a href="http://developercoach.com/2009/file-system-fragmentation/">this post</a> for some details), but the most interesting one in terms of fragmentation is on the fly defragmentation.</p>
<p>In a nutshell, when any file under 20mb in size is opened, the system checks to see if it&#8217;s fragmented.  If it is, and some other conditions are met, then the file is automatically, instantly defragmented.</p>
<p>This works great for keeping those &#8220;small&#8221; files defragmented, but back when this feature was first added to HFS+ about 8 years ago, a 20mb file was pretty large.  Not so anymore.</p>
<p>Another change in the demands on the file system is the advent of iTunes, and large media files.  It&#8217;s not uncommon today to be downloading podcasts that are more than 20mb, in addition to video podcasts that are hundreds of megabytes, and movies that are a gigabyte or more.  It&#8217;s also quite easy with iTunes to fill your hard drive with downloaded media.</p>
<p>Check out this fragmentation report of the hard drive in my laptop:</p>
<p><img src="http://blog.stevex.net/files/2010/10/201010020858.jpg" height="305" width="423" border="1" hspace="4" vspace="4" alt="201010020858" /></p>
<p>That 1st file, a recent download, is split into 12,599 fragments.  To put that in perspective, the drive I have in that laptop has a random seek time of about 12ms.  12ms x 12599 is 151 seconds.  That&#8217;s how much time the drive could spend just seeking to read this one file!  </p>
<p>The 2nd file is an iPad application.  The 4th, 5th, and 6th files are also iTunes downloads.  In fact, most of the fragmented files are.</p>
<p>There were only a couple of files under 20mb that had any fragmentation at all, so the auto-defrag is doing its job.  But 20mb is too small a size for automatic defragmentation in 2010.  In fact, as far as I&#8217;m concerned, any attempt to open a fragmented file, no matter how big it is, should be considered &#8211; if not for instant defragmentation, then for being added to a queue of files scheduled for background defragmentation.  But even if that&#8217;s out of the picture, the 20mb size should be increased respective to the size and performance increase of computers since 2003, to at least 200mb.<br />
(It&#8217;s not configurable &#8211; you can see in the source <a href="http://lxr.linux.no/darwin-xnu+517.9.4/bsd/hfs/hfs_vnops.c">here</a> that it&#8217;s a constant <span style="font-family:monospace;">(20 * 1024 * 1024)</span>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stevex.net/2010/10/fragmentation-on-mac-os-x-time-for-a-change/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MacHeist NanoBundle pointer</title>
		<link>http://blog.stevex.net/2009/11/macheist-nanobundle-pointer/</link>
		<comments>http://blog.stevex.net/2009/11/macheist-nanobundle-pointer/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 03:47:51 +0000</pubDate>
		<dc:creator>stevex</dc:creator>
				<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://blog.stevex.net/?p=1570</guid>
		<description><![CDATA[MacHeist runs occasional deals on Mac software and right now there&#8217;s a pretty good one: Get six Mac apps, absolutely free. I&#8217;m not familiar with most of the apps but the one of them that I am makes the whole bundle worth getting. WriteRoom. WriteRoom gives you a completely distraction-free screen to write in. It [...]]]></description>
			<content:encoded><![CDATA[<p>MacHeist runs occasional deals on Mac software and right now there&#8217;s a pretty good one:  <a href="http://www.macheist.com/">Get six Mac apps, absolutely free</a>.</p>
<p>I&#8217;m not familiar with most of the apps but the one of them that I am makes the whole bundle worth getting.  <a href="http://www.macheist.com/#writeroom">WriteRoom</a>.</p>
<p>WriteRoom gives you a completely distraction-free screen to write in.  It works like TextEdit, but when you hit Escape it toggles between a normal Mac window, and a full-screen <a href="http://en.wikipedia.org/wiki/Green-screen_display">green-screen</a> style console.  </p>
<p>It&#8217;s a unique way to get some writing done.  Definitely worth the price.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stevex.net/2009/11/macheist-nanobundle-pointer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tweetie Review</title>
		<link>http://blog.stevex.net/2009/11/tweetie-review/</link>
		<comments>http://blog.stevex.net/2009/11/tweetie-review/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 02:04:23 +0000</pubDate>
		<dc:creator>stevex</dc:creator>
				<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://blog.stevex.net/?p=1566</guid>
		<description><![CDATA[Looking for a Twitter client? Own a Mac? Get Tweetie. That&#8217;s an ad up there at the top of my feed. Tweetie puts those in until you pay for it, and I haven&#8217;t paid yet. Likely I will, though, even with the great free clients out there like TweetDeck. There are two things that make [...]]]></description>
			<content:encoded><![CDATA[<p>Looking for a <a href="http://www.twitter.com">Twitter</a> client?  Own a Mac?  Get <a href="http://www.atebits.com/tweetie-mac/">Tweetie</a>.</p>
<p><a href="http://blog.stevex.net/files/2009/11/200911032115.jpg" onclick="window.open('http://blog.stevex.net/files/2009/11/200911032115.jpg','popup','width=494,height=501,scrollbars=no,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=yes,left=0,top=0');return false"><img src="http://blog.stevex.net/files/2009/11/200911032115-tm.jpg" height="300" width="295" border="1" hspace="4" vspace="4" alt="200911032115" /></a><br />
That&#8217;s an ad up there at the top of my feed.  Tweetie puts those in until you pay for it, and I haven&#8217;t paid yet.  Likely I will, though, even with the great free clients out there like <a href="http://www.tweetdeck.com/beta/">TweetDeck</a>.</p>
<p>There are two things that make this my favourite Twitter client.   You can close the Tweetie window without closing the app.  That&#8217;s just good Mac behaviour.  And, it&#8217;s got great keyboard support.  </p>
<p>Tweetie also adds a menu bar notification icon that indicates when there&#8217;s new stuff &#8211; not just in the people you follow but in the searches you&#8217;ve marked as favourites as well.  I prefer the passive notification to Growl popups for Twitter updates &#8211; most tweets aren&#8217;t worth interrupting me for.</p>
<p>The free version is ad-supported so it&#8217;s easy to check it out.  </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stevex.net/2009/11/tweetie-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

