tag:blogger.com,1999:blog-77255948621554309672019-02-08T02:44:43.335-08:00WiredBob's BlogiOS Engineering and General TechnologyRobert Connhttp://www.blogger.com/profile/03582638992809878687noreply@blogger.comBlogger17125tag:blogger.com,1999:blog-7725594862155430967.post-77838461450970073432013-12-16T14:40:00.002-08:002013-12-16T14:45:38.524-08:00Clean Installation of a Fusion Drive equipped MacArrgghh! &nbsp;I have just been through the pain of a Fusion drive logical volume group having some unallocated space, and not being able to reclaim it through Disk Utility. &nbsp;How I got there is a long story involving many failed attempts at installing Bootcamp Windows 8, and I'm not going to go into it because at the moment it is too painful... &nbsp;Just one lesson - don't create unallocated space on a Fusion Drive (or perhaps any other configuration) as you may not be able to reclaim it without erasing the drive.<br /><br />The situation with the unallocated space is apparently a "feature" of Mac OS X's recovery partition. &nbsp;On my 1TB physical disk I had 3 partitions -<br /><br />1. &nbsp;The EFI boot partition.<br />2. &nbsp;The bulk of the actual disk for real files.<br />3. &nbsp;The hidden recovery partition &lt;-- this is between 2 and 4 and prevents 2 from being resized to absorb the unallocated space.<br />4. &nbsp;Some unallocated space.<br /><br />So to fix this, I decided to go the extreme route and reformat the hard drive and reinstall Mac OS X. &nbsp;Not as easy as it sounds. &nbsp;A reformat of the "drive" really only reformats (2) - as the EFI and recovery partitions are hidden in Disk Utility. &nbsp;You'll get the same problem even if you boot into recovery with Command-R or Internet Recovery with Command-Shift-R.<br /><br />To actually reformat an entire Fusion Drive, the easiest thing to do is break the Fusion Drive and then open Disk Utility. &nbsp;Disk Utility detects to bad state of the Fusion Drive and can restore the Logical Volume Group and Logical Volume configuration for you.<br /><br />Do this -<br /><br />1. Boot to Internet Recovery - hold down Command-Alt-R when you hear the boot chime.<br />2. Open Terminal under the Utilities menu.<br />3. Issue the command -<br /><br /><span style="font-family: Courier New, Courier, monospace;">diskutil cs list</span><br /><br />4. &nbsp;Find the UUID after the text "Logical Volume Group" and copy it -<br />5. &nbsp;Issue the command -<br /><br /><span style="color: red;">* WARNING THIS WILL ERASE DISKS IN YOUR VOLUME GROUP AND YOU WILL LOSE DATA *</span><br /><br /><span style="font-family: Courier New, Courier, monospace;">diskutil cs delete &lt;Paste UUID&gt;</span><br /><br />6. &nbsp;Exit Terminal and return to Disk Utility.<br />7. &nbsp;Disk Utility will see that the drive configuration is incorrect. &nbsp;When prompted allow it to repair the Fusion Drive - practically this is creating a Logical Volume Group again, containing your SSD and physical hard disk.<br /><br />Now that's done it's time to get the OS up and running again. &nbsp;These are the instructions for a Time Machine backup -<br /><br />1. &nbsp;Exit Disk Utility.<br />2. &nbsp;If your Time Machine backup is from a different version of OS X from your Recovery Partition forget about restoring from it directly in recovery. &nbsp;e.g. I had a Mavericks backup, and my recovery partition/Internet recovery has Mountain Lion. &nbsp;If you do the restore from the Time Machine backup, it will look like it has worked, but on reboot it will boot straight back to the recovery partition.<br />3. &nbsp;Choose a full install of OS X.<br />4. &nbsp;Once the full install completes go through the setup - create a temporary user so that when Time Machine restores your original user, the names won't clash!<br />5. &nbsp;Immediately go to the App Store and upgrade to the latest OS (the one that matches your Time Machine Backup) e.g. in my case Mavericks.<br />6. &nbsp;Once upgraded, open the Migration Assistant.<br />7. &nbsp;Select the Time Machine option, select your backup and proceed with the restore. &nbsp;This is when you wish you had a Thunderbolt external drive.<br />8. &nbsp;Once the restore finishes, log in as your old user, ensure they have administrator rights and then delete the temp user using System Preferences.<br /><br />Done. &nbsp;Now never mess around with unallocated space again!<br /><br />Robert Connhttp://www.blogger.com/profile/03582638992809878687noreply@blogger.com16tag:blogger.com,1999:blog-7725594862155430967.post-22796064628263848992011-10-10T15:37:00.000-07:002012-01-15T11:36:00.084-08:00MacBook Air and Filevault 2 won't sleep togetherI've just got a new MacBook Air and I'm not sure if it is mourning Steve's passing last week :( but I've been having a lot of trouble getting it to wake up from hibernate. Hibernate is the state that (by default) the computer will go into when it runs out of battery (after the reserve power warning appears).<br /><br />In this state it will immediately write the contents of memory to a swapfile on the solid state storage - by default to /var/vm/sleepimage. My theory is that there is a race condition with Filevault that may corrupt the memory image whilst both processes try to do their stuff on the storage. When the MacBook is plugged into a power source and the power button is pressed, the backlight lights but the screen stays black. I can see the backlight through the Apple logo on the lid. It stays in this state forever and needs to be hard reset by holding <em>power</em> for 10 seconds, releasing and pressing it again to switch the computer back on.<br /><br />I actually brought the MacBook Air back to the Apple Store and got a replacement which exhibits the same problem, so with the second one I did a little bit of experimentation to narrow down on the root cause. I did the following -<br /><ol><li>A complete Lion clean install (Command-R at bootup).</li><li>Let the battery run dry, MacBook Air hibernates and wakes successfully after applying power.</li><li>Applied Filevault.</li><li>Let the battery run dry, MacBook Air hibernates and crashes on wake after applying power.</li><li>Reset both PRAM and the SMC - neither helped.</li></ol><em>It's pretty clear Filevault is the problem.</em><br /><h1><span style="font-size: large;">The Workaround</span></h1>To work around this until Apple (hopefully) fix what is quite a glaring problem (happened on 2 MacBook Airs for me) it is possible to turn off hibernation. This means that the machine will only sleep - contents of memory remain in RAM which remains powered for as long as the battery holds up. Remember, this differs from "SafeSleep" or hibernate - it persists memory to flash storage so that even if the battery runs out, the memory image can be restored and you can just carry on with your work.<br /><ul><li>First off, check your existing hibernate mode (it will usually be 3 - the default)</li></ul>Open a Terminal window and type -<br /><br /><pre><code><span style="font-family: 'Courier New', Courier, monospace;">sudo pmset -g | grep hibernatemode<br />Password: &lt;enter password&gt;<br />hibernatemode 3</span></code></pre><ul><li>Look at the man page for pmset to see the valid hibernate modes -<br /><br /><div style="text-align: left;"><span style="font-family: 'Courier New', Courier, monospace;">man pmset</span></div><br />The relevant part -<br /><br /><span style="font-family: 'Courier New', Courier, monospace;">We do not recommend modifying hibernation settings. Any changes you make are not supported. If you choose to do so anyway, we recommend using one of these three settings. For your sake and mine, please don't use anything other 0, 3, or 25.</span><br /><span style="font-family: 'Courier New', Courier, monospace;"><br /></span><span style="font-family: 'Courier New', Courier, monospace;">hibernatemode = 0 (binary 0000) by default on supported desktops. The system will not back memory up to persistent storage. The system must wake from the contents of memory; the system will lose context on power loss. This is, historically, plain old sleep.</span><br /><span style="font-family: 'Courier New', Courier, monospace;"><br /><br /></span><span style="font-family: 'Courier New', Courier, monospace;">hibernatemode = 3 (binary 0011) by default on supported portables. The system will store a copy of memory to persistent storage (the disk), and will power memory during sleep. The system will wake from memory, unless a power loss forces it to restore from disk image.</span><br /><span style="font-family: 'Courier New', Courier, monospace;"><br /><br /></span><span style="font-family: 'Courier New', Courier, monospace;">hibernatemode = 25 (binary 0001 1001) is only settable via pmset. The system will store a copy of memory to persistent storage (the disk), and will remove power to memory. The system will restore from disk image. If you want "hibernation" - slower sleeps, slower wakes, and better battery life, you should use this setting.</span><br /><span style="font-family: 'Courier New', Courier, monospace;"><br /></span></li><li>The crash happens for both hibernatemode 3 and 25 (I've tested both). To set hibernatemode to 0 (i.e. turn it off) use the following command -<br /><br /><span style="font-family: 'Courier New', Courier, monospace;">sudo pmset -a hibernatemode 0</span><br /><span style="font-family: 'Courier New', Courier, monospace;"><br /></span></li><li>And to switch it back to the default -<br /><br /><span style="font-family: 'Courier New', Courier, monospace;">sudo pmset -a hibernatemode 3</span></li></ul>Hopefully Apple fix this one soon. With the workaround about just bear in mind that if you go into sleep after the reserve power warning you will have some leeway to get to power, but don't leave it a really long time otherwise you could end up losing work. Best to save if you hit reserve power anyway.<br /><br />As a side effect of this change it is possible to remove the safe sleep image (which is exactly the size of the memory on your MacBook Air) as obviously Lion won't write to it with hibernation turned off -<br /><br /><pre><code><span style="font-family: 'Courier New', Courier, monospace;">sudo rm /var/vm/sleepimage</span><br /></code></pre><br />All these steps at your own risk, but it works for me. Other posts on this topic can be found here -<br /><br /><a href="https://discussions.apple.com/thread/3263450?start=0&amp;tstart=0">Apple Discussion 1</a><br /><a href="https://discussions.apple.com/thread/3212695?start=0&amp;tstart=0">Apple Discussion 2</a><br /><br /><em>UPDATE</em> Should have mentioned that this testing was done on Mac OS X Version 10.7.1 and I've tested hibernatemode 3 on 10.7.2 and see the same behaviour - so no bug fix yet :(<br /><br /><em>UPDATE</em> Bug filed at the <a href="http://bugreport.apple.com/">Apple Bug Reporter</a> (#10288882)<br /><br /><span style="font-family: Times, 'Times New Roman', serif;"><i>UPDATE</i>&nbsp;<span style="background-color: white; color: #333333; line-height: 13px; text-align: justify;">Macbook Air EFI 2.3</span><span style="background-color: white; color: #333333; line-height: 13px; text-align: justify;">&nbsp;fixed this issue for me!</span></span>Robert Connhttp://www.blogger.com/profile/03582638992809878687noreply@blogger.com11tag:blogger.com,1999:blog-7725594862155430967.post-77092139179200201892011-10-08T14:28:00.000-07:002012-01-09T14:29:37.356-08:00So long Steve and thanks for all the Lulz<p>5th October was a sad day - Steve Jobs passed away.</p><br /><p>I was walking through the Apple Store yesterday and although I had been thinking that Steve's biggest legacy was his contribution to defining the PC market as it is today, something else struck me. &nbsp;Upstairs a grandmother with her grandson was setting up her first iPad 2, helped by an Apple Store employee. &nbsp;I walked downstairs and passed an iPad 2 demonstration. &nbsp;The audience was full of people aged between 60 and 70, all following along on their iPads. &nbsp;</p><br /><p>When I got home, my daughter was playing her games on her iPad - working with the touch screen like she had been born with it.</p><br /><p>I think Steve's legacy was really his ability to make technology and communication span generations and make the experience accessable to all. &nbsp;I'm not sure we have anyone to take his place. &nbsp;RIP Steve.</p><br />Robert Connhttp://www.blogger.com/profile/03582638992809878687noreply@blogger.com1tag:blogger.com,1999:blog-7725594862155430967.post-53045311961819561152011-05-23T09:53:00.000-07:002012-01-09T14:29:37.370-08:00Windiest day ever!<p><img class='iphone-image' src='/resource/iphone-20110523175348-1.jpg?fileId=12350367'/></p><p></p><br />Robert Connhttp://www.blogger.com/profile/03582638992809878687noreply@blogger.com1tag:blogger.com,1999:blog-7725594862155430967.post-45598607361000679502011-04-15T16:05:00.000-07:002012-01-09T14:29:37.382-08:00Bob's Most Useful Apps - Part 1- Camscanner+<p>Camscanner+ is a really clever idea that can be used in a number of ways to improve your day to day workflow. At it's heart it is a really simple app - take photos of anything - documents, whiteboards, receipts - and Camscanner+ will store images of them on your phone for later reference.</p><br /><p>Thats not all though. First off, Camscanner+ will enhance images with a clever algorithm that identifies only the relevant part of an image and zooms, flattens and centres the subject to produce a very readable document. After that, it applies an enhancement filter to up the clarity of the final image.</p><br /><p><span class="full-image-block ssNonEditable"><span>&nbsp;</span></span></p><br /><p style="text-align: center;"><img style="width: 200px;" src="/storage/post-images/camscanner_2.PNG?__SQUARESPACE_CACHEVERSION=1303428092133" alt="" /></p><br /><p style="text-align: center;"><strong>Take a photo of a document or receipt...</strong></p><br /><p style="text-align: center;"><span class="full-image-block ssNonEditable"><span><img style="width: 200px;" src="/storage/post-images/camscanner_3.PNG?__SQUARESPACE_CACHEVERSION=1303428289776" alt="" /></span></span></p><br /><p style="text-align: center;"><strong>... and Camscanner+ automatically enhances and aligns the image</strong></p><br /><p>The application also allows folder based grouping of documents so that you can, for example, record all the receipts for a particular business trip together. You can also add metadata tags to the content to further categorise documents.</p><br /><p><span class="full-image-block ssNonEditable"><span>&nbsp;</span></span></p><br /><p style="text-align: center;"><img style="width: 200px;" src="/storage/post-images/camscanner_1.PNG?__SQUARESPACE_CACHEVERSION=1303428030813" alt="" /></p><br /><p style="text-align: center;"><strong>Camscanner+ folder view</strong></p><br /><p>The app has a large number of export options to choose from. As well as the usual email option, Camscanner+ integrates Google Docs, Evernote, iDisk, Box.net, Dropbox. My favourite workflow is scanning all my receipts for a particular business trip into a folder, exporting a PDF of all the documents in the folder to Dropbox for safekeeping and then sending that directly to our expenses people for remittance. No more posting receipts for me! My only complaint is that it appears to be impossible to control the image size of the documents within the PDF, potentially creating a very large file depending on the number of documents you have.</p><br /><p>The other great use for Camscanner+ is scanning whiteboards and the enhancement tools generally produce a very clear result. If you are looking for something to quickly scan documents, receipts and diagrams Camscanner+ is the tool of choice.</p><br /><p><a href="http://itunes.apple.com/us/app/camscanner/id388624839?mt=8">Camscanner+ can be found on the Apple App Store for &pound;2.99</a>.&nbsp; I'm not affiliated with the app in any way ... I just really like it!</p><br /><p>&nbsp;</p><br />Robert Connhttp://www.blogger.com/profile/03582638992809878687noreply@blogger.com1tag:blogger.com,1999:blog-7725594862155430967.post-69894600835019954602011-02-20T11:16:00.000-08:002012-01-09T14:29:37.395-08:00This week vs last<p>I was in Lanzarote last week, weather much the same as this.</p><br /><p><img class="iphone-image" src="/resource/iphone-20110220191610-1.jpg?fileId=10840350" alt="" /></p><br /><p>And this week I'm back home and can look forward to this.</p><br /><p><img class="iphone-image" src="/resource/iphone-20110220191610-2.jpg?fileId=10840351" alt="" /></p><br /><p>Enough said...</p><br /><p>&nbsp;</p><br />Robert Connhttp://www.blogger.com/profile/03582638992809878687noreply@blogger.com1tag:blogger.com,1999:blog-7725594862155430967.post-26854129197210342132010-04-20T11:16:00.000-07:002012-01-09T14:29:37.407-08:00The Big Wheel Test continues...<p><img class='iphone-image' src='http://www.wiredbob.com/resource/iphone-20100420191646-1.jpg?fileId=6615960'/></p><p>A major test this weekend for the new Harry Rowland wheels - towing a Chariot child trailer with baby inside. No problems yet after 4 commutes with alot of curb bumping and the towing. Whilst heavy, the wheels are definitely strong and smooth. I reckon it'll take about 3 months for a full long term test but so far I'm impressed. </p><p>As far as the trailer goes, it's amazing! Really comfortable for the baby with good safety harnesses. Folds down and wheels are removable to fit in the boot. It is a bit heavy but that just adds to the training!<br /> </p><br />Robert Connhttp://www.blogger.com/profile/03582638992809878687noreply@blogger.com1tag:blogger.com,1999:blog-7725594862155430967.post-63096095697507545702010-04-11T23:43:00.000-07:002012-01-09T14:29:37.572-08:00Time to get back on the bike<p><img class='iphone-image' src='http://www.wiredbob.com/resource/iphone-20100412074351-1.jpg?fileId=6502918'/></p><p>First time that my Thorn commuting bike is back on the road since October last year. I'm giving the new Harry Rowland wheels a big test with all that weight on the back!</p><br />Robert Connhttp://www.blogger.com/profile/03582638992809878687noreply@blogger.com0tag:blogger.com,1999:blog-7725594862155430967.post-74443765560032934782010-04-05T03:07:00.000-07:002012-01-09T14:29:37.586-08:00New Harry Rowland Wheelset<p>I've just received a set of handmade <a href="http://www.harryrowland.co.uk/">Harry Rowland</a> wheels for my commuting bike. &nbsp;For a while I've been putting up with a set of factory build wheels from SJS Cycles - but they are cheap and of poor quality. &nbsp;For the weight I carry they have continually broken spokes so I felt it was about time for an upgrade to something a little better.</p><br /><p>Harry Rowland is a well-known wheelbuilder - you only have to do a <a href="http://www.google.co.uk/search?q=harry+rowland">quick Google</a> to find positive comments and reviews of his work. &nbsp;I had a chat with Harry and he recommended a set of Rigida 36h rims with Sputnik hubs for my weight and commuting requirements. &nbsp;You can see the wheels in the photos below. &nbsp;</p><br /><p>First impressions are that the wheels are really strong and running perfectly true (as you'd expect). &nbsp;I'm going to get these on the bike shortly. &nbsp;With wheels a long term test is required - so i'll post my thoughts in a few weeks time.</p><br /><p><span class="full-image-block ssNonEditable"><span><img style="width: 300px;" src="/storage/post-images/IMG_7050 2.jpg?__SQUARESPACE_CACHEVERSION=1270495218903" alt="" /></span></span></p><br /><p><br /><span class="full-image-block ssNonEditable"><span><img style="width: 500px;" src="/storage/post-images/IMG_7049%203.jpg?__SQUARESPACE_CACHEVERSION=1270495306250" alt="" /></span></span></p><br /><p><span class="full-image-block ssNonEditable"><span><img src="/storage/post-images/IMG_7048%204.jpg?__SQUARESPACE_CACHEVERSION=1270495623826" alt="" /></span></span></p><br /><p>&nbsp;</p><br /><p><span class="full-image-block ssNonEditable"><span><img style="width: 500px;" src="/storage/post-images/IMG_7047%205.jpg?__SQUARESPACE_CACHEVERSION=1270495763455" alt="" /></span></span>&nbsp;</p><br />Robert Connhttp://www.blogger.com/profile/03582638992809878687noreply@blogger.com1tag:blogger.com,1999:blog-7725594862155430967.post-60843461357482881352009-08-31T14:53:00.000-07:002012-01-09T14:29:37.604-08:00Reviewing Videos on Apple TV with Automator<p>The new Services support in <a href="http://www.apple.com/macosx/">Snow Leopard</a> has got me interested in "really smoothing my Mac workflows", a term used by the demonstrator with the crazy hair at the last Apple keynote.</p><br /><p><span class="full-image-block ssNonEditable"><span><img src="/storage/post-images/Smoothing%20Mac%20Workflows.png?__SQUARESPACE_CACHEVERSION=1251926310347" alt="" /></span></span></p><br /><p>I take a lot of home movies with a <a href="http://www.kodak.com/eknec/PageQuerier.jhtml?pq-path=13063&amp;pq-locale=en_GB&amp;_requestid=9571">Kodak Zi6</a>; it's a cheap, but cheerful, HD handheld video camera that produces great looking images with not so hot audio. &nbsp;I want to use my Apple TV to quickly review the home movies I produce on the camera - but that can be awkward. &nbsp;The Quicktime wrapped files produced aren't quite compatible with Apple TV directly and so I've had to use a manual workflow of opening the files in iMovie, exporting to Apple TV, importing to iTunes and then syncing to finally get them onto the Apple TV.</p><br /><p>With Quicktime 10, and the new Services support in Snow Leopard it is now possible to build a simple Automator workflow that allows me to -</p><br /><ol><br /><li>Select any number of Zi6 movies in the Finder.</li><br /><li>Right click, and select the "Review on Apple TV" service that i've built using Automator and some Applescript.</li><br /><li>The service will pick up all the selected files and send them to Quicktime for output in "Apple TV" format.</li><br /><li>It then uses some Applescript to import the converted files into iTunes, ready for syncing with my Apple TV.</li><br /></ol><br /><p>The workflow is attached to the article for download. &nbsp;Unzip the file and place it in your <em>~/Library/Services</em> folder and then you can immediately right click any movie file and select the option to "<strong>Review on Apple TV</strong>". &nbsp;It can also be opened in Automator and freely modified.</p><br /><p>I still haven't perfected the workflow. &nbsp;I want to add some metadata (specifically genre = "For Review") to the converted files so that I can quickly find them on the Apple TV. &nbsp;I also want to trigger a sync on the Apple TV automatically but I can't see how that is possible in Applescript. &nbsp;For now though, it works pretty well as a simple first start.</p><br /><p><a href="/storage/files/services/Service_Review_on_Apple_TV_v1.zip">Download the Service here</a></p><br />Robert Connhttp://www.blogger.com/profile/03582638992809878687noreply@blogger.com1tag:blogger.com,1999:blog-7725594862155430967.post-77704311652005380212009-08-27T15:49:00.000-07:002012-01-09T14:29:37.621-08:00Keynote Remote with Macbook Pro Ad-hoc Network<p>I'm giving a presentation in about a month and I'm planning to use Keynote on my Macbook Pro. &nbsp;I was hoping to use the iPhone <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=300719251&amp;mt=8">Keynote Remote</a> app, to act as a very modern version of a slide changer (if that's what you call it?). &nbsp;Keynote Remote expects both the host computer and the iPhone to be on the same network; but there are numerous reports of connection problems between both, not to mention the fact that you don't always have a Wifi network available at presentation venues.</p><br /><p>Then, I had the bright idea of using the ability of Mac OS X to create an ad-hoc wireless network by clicking the Airport icon in the menu bar and clicking "Create Network...". &nbsp;When I tried to connect the iPhone to the new network (Settings/Wifi) it appeared to connect - but the menubar network icon still showed a worse than Edge connection (I get terrible reception here). &nbsp;Keynote Remote would work for a few slides, but then the connection would drop out - making it useless.</p><br /><p>After the usual Googling, I stumbled across <a href="http://discussions.apple.com/thread.jspa?threadID=1855552&amp;start=15&amp;tstart=0">this Apple thread</a> which suggested turning Airplane mode on in Settings, and THEN connecting to the ad-hoc network. &nbsp;For some reason the iPhone now shows a Wifi connection and Keynote Remote seems to be working reliably. &nbsp;Excellent tip!</p><br />Robert Connhttp://www.blogger.com/profile/03582638992809878687noreply@blogger.com1tag:blogger.com,1999:blog-7725594862155430967.post-76403953069037687712009-05-23T15:56:00.000-07:002012-01-09T14:29:37.673-08:00Eclipse Working Sets<p>Eclipse is a fantastic IDE, especially for developing Java code. However, recently I've been getting a little irritated by its speed. This is probably exacerbated by the fact that the code I'm working on has about 20 Eclipse projects in it's source tree and thousands of source files. Eclipse gives the developer plenty of help - it does code completion, resolves dependencies, performs automatic imports and refactors across projects - all of which come at a cost. I'm not sure how much time i've spend waiting for my workspace to build, but it can be 10% of the day at worst! Even navigation through that many files becomes a productivity issue.<br /><br />Recently i've found what is probably a fairly obvious feature of Eclipse but if you haven&rsquo;t found yet it the concept of &ldquo;Working Sets&rdquo; should be useful.<br /><br />Working sets are a way of choosing only those projects and files that are relevant for the task in hand. It's an alternative, more focussed way to view source files and resources that the Project Explorer - that can really get out of hand if you are working with more than, say, 10 projects. At the simplest level, working sets allow you to configure multiple profiles of visible projects that you can select from depending on the task you are performing. For example, if you are only working on the Eclipse projects that deal with order management in your system, you can select the &ldquo;Order Management&rdquo; working set and it will show only those Eclipse projects in the Project Explorer.<br /><br />You can also bring working sets much further - you can select individual packages and files to form part of the working set (you can even create a working set of breakpoints), so you can be very specific about what you want to split out and see in context. All-in-all it is a useful way to make your Eclipse environment significantly easier to navigate.<br /><br />To manage working sets use the dropdown arrow on the Project Explorer.</p><br /><p><span class="full-image-block ssNonEditable"><span><img style="width: 500px;" src="/storage/post-images/workingsets_menu.png?__SQUARESPACE_CACHEVERSION=1243119562473" alt="" /></span></span></p><br /><p>Click <strong>New...</strong> to create a new working set and select the type of set you want. The default Java type is usually fine for Java programming.</p><br /><p><span class="full-image-block ssNonEditable"><span><img style="width: 500px;" src="/storage/post-images/workingsets_new.png?__SQUARESPACE_CACHEVERSION=1243119186427" alt="" /></span></span></p><br /><p>Select the various resources that should be part of the set, and give it a name. The resources can be anything - files, packages or projects.</p><br /><p><span class="full-image-block ssNonEditable"><span><img style="width: 500px;" src="/storage/post-images/workingsets_resources.png?__SQUARESPACE_CACHEVERSION=1243119571558" alt="" /></span></span></p><br /><p>Finally, use the dropdown menu on the Project Explorer to change active sets.<br /><br />See the video tutorials here for a walkthrough <a href="http://www.peterfriese.de/eclipse-working-sets-part-i/">http://www.peterfriese.de/eclipse-working-sets-part-i/</a>.</p><br /><p><img src="file:///Users/Robert/Library/Caches/TemporaryItems/moz-screenshot-4.jpg" alt="" /></p><br /><p><img src="file:///Users/Robert/Library/Caches/TemporaryItems/moz-screenshot-3.jpg" alt="" /></p><br /><p><img src="file:///Users/Robert/Library/Caches/TemporaryItems/moz-screenshot-2.jpg" alt="" /></p><br /><p><img src="file:///Users/Robert/Library/Caches/TemporaryItems/moz-screenshot-1.jpg" alt="" /></p><br /><p><img src="file:///Users/Robert/Library/Caches/TemporaryItems/moz-screenshot.jpg" alt="" /></p><br />Robert Connhttp://www.blogger.com/profile/03582638992809878687noreply@blogger.com1tag:blogger.com,1999:blog-7725594862155430967.post-58044643786422776602009-05-08T15:06:00.000-07:002012-01-09T14:29:37.641-08:00New iPhone Apps to be tested on iPhone OS 3 Beta 5<p><span class="full-image-float-left ssNonEditable"><span><img src="/storage/post-images/icon_iphonesdk3.png?__SQUARESPACE_CACHEVERSION=1241820673157" alt="" /></span></span>Any new iPhone apps submitted to the App Store for evaluation will from now be tested on iPhone OS 3, beta 5.&nbsp; Developers need to make sure their apps are well tested on the new beta before submission, otherwise they could fail the process.</p><br /><p>Beta 5 of both the iPhone OS and the SDK are available on <a href="http://developer.apple.com">ADC</a> if you're a registered iPhone developer.</p><br /><p>&nbsp;</p><br />Robert Connhttp://www.blogger.com/profile/03582638992809878687noreply@blogger.com1tag:blogger.com,1999:blog-7725594862155430967.post-9146519340391495932009-05-05T16:26:00.000-07:002012-01-09T14:29:37.656-08:00Squarespace to do iPhone App<p>I've been looking around on the iTunes Store for an app that does some basics for Squarespace - blog posts, basic comment management, viewing of stats etc. It appears there is an official one on the <a href="http://developers.squarespace.com/features-system/post/481395">way</a>. I know that <a href="http://ego-app.com/">Ego</a> is an excellent app for browsing various site stat services - Feedburner, Google Analytics, Mint, Squarespace and Twitter are supported, but it doesn't do most of the extras a Squarespace specific app will do.</p><br />Robert Connhttp://www.blogger.com/profile/03582638992809878687noreply@blogger.com0tag:blogger.com,1999:blog-7725594862155430967.post-4371519341779521112009-04-20T15:36:00.000-07:002012-01-09T15:10:06.527-08:00iPhone Tweetie Style Navigation Framework<div class="separator" style="clear: both; text-align: center;"><br /></div>I love the iPhone Twitter client Tweetie - it has a really excellent navigation framework that makes it fast to navigate between multiple Twitter accounts.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-LTi40ssQe24/TwtxOeowIKI/AAAAAAAAAAQ/pvbJp0bot8U/s1600/Tweetie.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="191" src="http://4.bp.blogspot.com/-LTi40ssQe24/TwtxOeowIKI/AAAAAAAAAAQ/pvbJp0bot8U/s400/Tweetie.png" width="400" /></a></div><br /><br />I'm developing an iPhone app that logs actions against one or more persons and thought that Tweetie's navigation style would suit. Tweetie uses a navigation controller to handle the hierarchical nature of browsing account/tweets/users but also uses a tab bar to navigate between various views - a user's tweets, their mentions, DMs etc.&nbsp; Investigating the Apple documentation, having a tab bar controller within a navigation controller is not a <a href="http://developer.apple.com/iPhone/library/featuredarticles/ViewControllerPGforiPhoneOS/CombiningToolbarandNavigationControllers/CombiningToolbarandNavigationControllers.html">supported Apple user interface approach</a> - the iPhone SDK doesn’t support it and trying results in a blank tab bar when you navigate to the view hosting it. I then <a href="http://stackoverflow.com/questions/576764/tab-bar-controller-inside-a-navigation-controller-or-sharing-a-navigation-root-v">found this post</a>, with a comment from Tweetie developer himself, <a href="http://twitter.com/atebits">@atebits</a>, alluding to the fact that a custom tab view controller solution is required. <br /><br />The general steps are outlined below and full source code that can be used as a template for your own projects is posted at <a href="http://github.com/wiredbob/NavTab">GitHub</a>. I recommend you download this now for reference while working through this article.<br /><br /><h3>The App Delegate</h3>The App Delegate holds the navigation controller - this controller is at the root of the view tree and contains any other view controller that is pushed onto it. The navigation bar at the top of the screen that handles the navigation back and forth between views is to a large extent, managed automatically by the navigation controller.<br /><br />As discussed previously, the issue with current versions of the SDK is that <em>a tab bar controller cannot be pushed onto a navigation controller</em>.<br /><br />Now, have a look at MainWindow.xib in Interface Builder.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-aOmlJxgpUF8/TwtxboiY8mI/AAAAAAAAAAw/YNsoFAmkO1M/s1600/IBNavController.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-aOmlJxgpUF8/TwtxboiY8mI/AAAAAAAAAAw/YNsoFAmkO1M/s1600/IBNavController.png" /></a></div>Note that the navigation controller has a “root view controller”. This is the controller that handles the first view that is pushed onto the navigation controller. Opening <strong>RootViewController.h</strong> reveals that the controller is inherited from UITableViewController. It is fairly typical that the navigation controller oversees multiple levels of table views.<br /><blockquote><blockquote class="tr_bq">@implementation BabyBookAppDelegate<br />@synthesize window;<br />@synthesize navigationController;</blockquote></blockquote><br /><h3>The Root View Controller</h3>In Tweetie, the root view controller is the list of Twitter accounts. In my sample code, each table cell is driven from a simple array of strings (people’s names) for demonstration purposes.<br /><blockquote><blockquote class="tr_bq">self.title = @"Accounts";<br />NSArray *array = [[NSArray alloc] initWithObjects:@"Jack", @"Jill", @"John", nil];<br />self.accounts = array;<br />[array release];</blockquote></blockquote>When a cell is clicked, the delegate method <strong>didSelectRowAtIndexPath</strong> is executed. This pushes the custom tab view controller onto the navigation controllers stack. Note, that this is a custom tab view controller, and does not inherit from the typical SDK class UITabViewController. This means that there is some extra work to manually build this view controller, and also the view it owns.<br /><blockquote><blockquote class="tr_bq">- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {<br />[self.tabViewController setTitle:[accounts objectAtIndex:indexPath.row]];<br />[self.navigationController pushViewController:self.tabViewController animated:YES];<br />}</blockquote></blockquote><br /><h3>The UICustomTabViewController</h3>Open <strong>TabViewController.xib</strong>. Have a look at the structure of the interface. I've manually created a Tab Bar, which in this case contains the two default tab bar items - <em>Favourites</em> and <em>More</em>. These two buttons have associated view controllers that own the view that appears when a button is clicked. The UICustomTabViewController class manages the switching of the views by maintaining (a) an array of the view controllers and (b) a reference to the selected view controller.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-NGsgWeQxi90/TwtxhlhvCJI/AAAAAAAAABA/BLU_EyPKDfY/s1600/NavTabTabView.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-NGsgWeQxi90/TwtxhlhvCJI/AAAAAAAAABA/BLU_EyPKDfY/s1600/NavTabTabView.png" /></a></div><br />The controller also acts as a delegate for the tab bar, so can respond to taps on the tab bar items through the <strong>didSelectItem</strong> delegate method. Based on the item tapped, a reference to the appropriate view controller (Favourites or More) is pulled from the array of view controllers. The current view is removed from the superview and the <em>view of the selected view controller</em> is then added to the UICustomTabViewController’s view. Really, the view above the tab bar is getting swapped out for a new view, depending on which tab bar item is tapped.<br /><blockquote><blockquote class="tr_bq">- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item<br />{<br />&nbsp;&nbsp; if (item == favouritesTabBarItem) {<br />&nbsp;&nbsp;&nbsp;&nbsp; UIViewController *fabViewController = [viewControllers objectAtIndex:0];<br />&nbsp;&nbsp;&nbsp;&nbsp; [self.selectedViewController.view removeFromSuperview];<br />&nbsp;&nbsp;&nbsp;&nbsp; [self.view addSubview:fabViewController.view];<br />&nbsp;&nbsp;&nbsp;&nbsp; self.selectedViewController = fabViewController;<br />&nbsp;&nbsp; } else if (item == moreTabBarItem) {<br />&nbsp;&nbsp;&nbsp;&nbsp; UIViewController *moreViewController = [viewControllers objectAtIndex:1];<br />&nbsp;&nbsp;&nbsp;&nbsp; [self.selectedViewController.view removeFromSuperview];<br />&nbsp;&nbsp;&nbsp;&nbsp; [self.view addSubview:moreViewController.view];<br />&nbsp;&nbsp;&nbsp;&nbsp; self.selectedViewController = moreViewController;<br />&nbsp;&nbsp; }<br />)</blockquote></blockquote><br /><h3>The More Tab</h3><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-7ftjpeiOXEw/TwtxfK4mVwI/AAAAAAAAAA4/IiEycgYoqls/s1600/NavTabMoreView.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-7ftjpeiOXEw/TwtxfK4mVwI/AAAAAAAAAA4/IiEycgYoqls/s1600/NavTabMoreView.png" /></a></div><br />The <strong>MoreTabViewController.m</strong> class controls another table view and demonstrates that the navigation controller can be used to manage further views in a hierarchy. The delegate method <strong>didSelectRowAtIndexPath</strong> will retrieve the navigation controller from the application delegate and push the view controller that handles the next view in the navigation hierarchy - <strong>MoreOptionViewController</strong>.<br /><blockquote><blockquote class="tr_bq">NavTabAppDelegate *delegate = [[UIApplication sharedApplication] delegate];<br />[delegate.navigationController pushViewController:moreOptionViewController animated:YES];<br />[moreOptionViewController.label setText:msg];</blockquote></blockquote>Again, the full source for the NavTab project is on <a href="http://github.com/wiredbob/NavTab">GitHub</a>.<br /><br />Further recommended reading -<br /><br /><a href="http://developer.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/Introduction/Introduction.html">Apple View Controller Programming Guide</a>Robert Connhttp://www.blogger.com/profile/03582638992809878687noreply@blogger.com45tag:blogger.com,1999:blog-7725594862155430967.post-65580453146871379472009-04-16T05:42:00.000-07:002012-01-09T14:29:37.706-08:00Wil Shipley's App Hype<p>I came across this video from the C4 conference of the famous Mac programmer Wil Shipley talking about how to generate hype and buzz for your applications.&nbsp; He talks alot of sense - in fact most of it seems like <em>common</em> sense - but there are alot of things that most of us probably won't pick up straight off.&nbsp; If you're a Mac/iPhone programmer you'd do well to take some of this onboard.</p><br /><p>I found out about Wil after downloading <a href="http://www.delicious-monster.com/">Delicious Library 2</a> as part of the Macheist bundle, and then realised he was one of the founders of <a href="http://www.omnigroup.com/">The Omni Group</a> - check out OmniGraffle if you want to draw fantastic looking diagrams!&nbsp; Great examples of simple, cool apps.&nbsp; He is also worth following <a href="http://twitter.com/wilshipley">@wilshipley</a>.</p><br /><p>&nbsp;</p><br /><p><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="437" height="369" id="viddler_b564166e"><param name="movie" value="http://www.viddler.com/player/b564166e/" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /><embed src="http://www.viddler.com/player/b564166e/" width="437" height="369" type="application/x-shockwave-flash" allowScriptAccess="always" allowFullScreen="true" name="viddler_b564166e"></embed></object></p><br />Robert Connhttp://www.blogger.com/profile/03582638992809878687noreply@blogger.com1tag:blogger.com,1999:blog-7725594862155430967.post-5398586169983980202009-04-12T10:32:00.000-07:002012-01-09T14:29:37.721-08:00How to rename an Xcode project<p>I've recently been working on a iPhone framework which performs <a href="http://www.atebits.com/tweetie-iphone/">Tweetie</a> style navigation - basically supporting a tab bar controller within a navigation controller, as this isn't supported natively by the iPhone SDK. I developed the framework in a seperate project and wanted to use this as a base for a new project I've just started working on. It's fairly simple to take a copy of an existing iPhone Xcode project and rename it for a new project - here are the steps I followed -</p><br /><ol><br /><li>In Finder, copy the old project directory to a new location and rename the folder to reflect the new project name.</li><br /><li>Move the <strong>&lt;oldproj&gt;.xcodeproj</strong> file in the project directory to <strong>&lt;newproj&gt;.xcodeproj</strong>.</li><br /><li>Open the new xcodeproj file/project in Xcode.</li><br /><li>If using version control on the provious project, turn that off - right click the project, Get Info and set the version control drop down value to "None".</li><br /><li>Refactor those classes that carry the <strong>&lt;oldproj&gt;</strong> name e.g. open the application delegate header file <strong>&lt;oldproj&gt;AppDelegate.h</strong>, right click the class name <strong>&lt;oldproj&gt;AppDelegate</strong> and then select refactor. Rename to <strong>&lt;newprog&gt;AppDelegate</strong>, <em>Preview</em> then <em>Apply</em>. Repeat this for any classes that hold the old name.</li><br /><li>In Other Sources, pick the <strong>&lt;oldproj&gt;_Prefix.pch </strong>file and refactor - rename to <strong>&lt;newproj&gt;_Prefix.pch</strong>.</li><br /><li>Select the <strong>&lt;oldproj&gt;</strong> build target and rename to <strong>&lt;newproj&gt;</strong>.</li><br /><li>Bring up info for the <strong>&lt;newproj&gt;</strong> target - Select &ldquo;All Configurations&rdquo;, &ldquo;All Settings&rdquo; and navigate through the build configuration settings changing these references of <strong>&lt;oldproj&gt;</strong> to <strong>&lt;newproj&gt;</strong><br /><em>Product Name<br />GCC_PREFIX_HEADER<br />Build and test </em></li><br /></ol><br /><p>&nbsp;</p><br />Robert Connhttp://www.blogger.com/profile/03582638992809878687noreply@blogger.com0