<?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>Mac Daddy World &#187; Objective-C</title>
	<atom:link href="http://macdaddyworld.com/category/objective-c/feed/" rel="self" type="application/rss+xml" />
	<link>http://macdaddyworld.com</link>
	<description>Stand back, here come the MacDaddies from Ecamm Network</description>
	<lastBuildDate>Tue, 26 Jan 2010 18:14:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Adventures in Cocotron</title>
		<link>http://macdaddyworld.com/2008/10/27/adventures-in-cocotron/</link>
		<comments>http://macdaddyworld.com/2008/10/27/adventures-in-cocotron/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 17:17:19 +0000</pubDate>
		<dc:creator>glen</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://macdaddyworld.com/?p=139</guid>
		<description><![CDATA[The Promise
The promise of Cocotron is a big one.  Wrote a Cocoa app?  Just add a new Xcode target, hit compile and out shoots a Windows version.  Your mountains of Objective-C code now cross compiles and is no longer stranded on the Mac.  You put your feet up, having just shipped [...]]]></description>
			<content:encoded><![CDATA[<p><B>The Promise</B></p>
<p><a href="http://www.cocotron.org/"><img src="http://macdaddyworld.com/wp-content/uploads/2008/10/logo.png" alt="" title="" width="40" height="40" class="alignright size-medium wp-image-182" /></a>The promise of <A HREF="http://www.cocotron.org">Cocotron</A> is a big one.  Wrote a Cocoa app?  Just add a new Xcode target, hit compile and out shoots a Windows version.  Your mountains of Objective-C code now cross compiles and is no longer stranded on the Mac.  You put your feet up, having just shipped a Windows app without ever touching a PC.  Your cat brings you a freshly brewed cup of coffee.  Read on for our journey from app to exe.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://click.linksynergy.com/fs-bin/click?id=bsOvCD5lW5Y&#038;offerid=146261.682077289&#038;type=10&#038;subid=http://click.linksynergy.com/fs-bin/click?id=bsOvCD5lW5Y&#038;offerid=146261.682077289&#038;type=10&#038;subid="><img src="http://macdaddyworld.com/wp-content/uploads/2008/10/nice_app.png" alt="" title="" width="412" height="66" class="alignnone size-full wp-image-181" /></a></p>
<p><B>The Goal</B></p>
<p>Back in August, we decided that we should have a Windows version of our <A HREF="http://www.filemagnetapp.com">FileMagnet Uploader</A>, a Mac application which connects to the iPhone via Bonjour and moves files back and forth between the desktop and our FileMagnet iPhone app.  If you&#8217;ve been in this situation before, you know how much fun a line-by-line Windows port can be.  Not only do you have to spend weeks hunched over Visual Studio, re-writing your entire program in a different language, but when you&#8217;re done you now have two separate code bases to manage.  When a friend recommended that we check out Cocotron as an alternative, we were quite skeptical but agreed to try it out.</p>
<p><B>The Proof</B></p>
<p><a href="http://macdaddyworld.com/wp-content/uploads/2008/10/sidebyside_full.png"><img src="http://macdaddyworld.com/wp-content/uploads/2008/10/sidebyside.png" alt="" title="sidebyside" width="460" height="339" class="alignnone size-full wp-image-153" /></a></p>
<p>Skip forward two months.  We are now shipping a Windows version of our <A HREF="http://www.filemagnetapp.com">FileMagnet Uploader</A>, built completely with Xcode from the same source files as the Mac version.  Visual Studio was never opened.  But wait&#8230; 2 months?</p>
<p><B>The Details</B></p>
<p>Let&#8217;s back up a bit. What is <a href="http://cocotron.org/">Cocotron</a>?  I&#8217;ll quote from the website:<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD><TD>&#8220;The Cocotron is an open source project which aims to implement a cross-platform Objective-C API similar to that described by Apple Inc.&#8217;s Cocoa documentation. This includes the AppKit, Foundation, Objective-C runtime and support APIs such as CoreGraphics and CoreFoundation.&#8221;</TD></TR></TABLE></p>
<p>In addition to this, you get a modified version of the gcc toolchain, allowing all this to be done from your Mac.  The project has an <A HREF="http://www.cocotron.org/Info/MIT_License">MIT License</A>.</p>
<p>It&#8217;s important to point out that Cocotron is targeting more than just Windows.  All of the platform specific code is nicely abstracted using a bridge pattern. The Foundation project is implemented for linux too.</p>
<p><B>Cross Platform?</B></p>
<p>Let&#8217;s back up even more&#8230;</p>
<p>Get a couple of Mac software engineers together around a table of Chinese food and eventually they&#8217;ll start to debate the best way to do a cross-platform app.  Usually, the nicest results come from using a combination of a cross-compiling core and platform specific UI code (a la  Safari, Skype, PhotoShop, etc.)  Anyone who&#8217;s tried to use most cross-compiling UI libraries knows that eventually what you end up with is an app that&#8217;s ugly and unruly on both platforms. At least with Cocotron, you end up with a beautiful Mac app, and hey, Windows apps are kind of ugly anyway so there&#8217;s no loss there.</p>
<p>Cocotron&#8217;s potential usefulness extends beyond user interface.  It also includes a reimplementation of the <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/Intro/IntroFoundation.html">Foundation framework</a>. Foundation provides the powerful data structures, string handling, threading, I/O, etc., which is what makes Cocoa great for rapidly and robustly coding an app&#8217;s core logic.  It would be a shame to have to use C++ for an app&#8217;s core instead of Foundation just because you need it to be cross platform.  I can imagine a cross platform app which combines an Objective-C core (using Cocotron&#8217;s port of Foundation) with separate Mac and Windows native UI implementations.</p>
<p><B>Back to Cocotron</B><br />
<a href="http://macdaddyworld.com/wp-content/uploads/2008/10/target.png"><img src="http://macdaddyworld.com/wp-content/uploads/2008/10/target.png" alt="" title="target" width="225" height="81" class="alignright size-full wp-image-164" /></a><br />
Simply follow the instructions to install Cocotron. Now, eagerly add the new Windows target to your Xcode project. Now, hit compile.  Now, wait while the errors pile up like  fan-boys at the Apple Store on a release day.</p>
<p>What&#8217;s wrong?  Whoops! It turns out that your app isn&#8217;t only Cocoa after all.  Okay, I&#8217;ll wait here while you go and #ifdef out all of that Mac specific code.  That&#8217;s right&#8230; go find all the Carbon and other Mac-only routines (any Frameworks you&#8217;re using outside of Cocoa, such as AddressBook, CoreData, IOKit, CoreAudio, etc.)  You&#8217;ll have to figure out how to port that stuff later. </p>
<p>Once your app is compiling, you&#8217;ll quickly realize that some methods appear at first glance to exist, but are actually just stubbed out for future implementation.  Ever want to implement a Cocoa class method?  Here&#8217;s your chance!</p>
<p><b>The Reality</b></p>
<p>The majority of Cocotron is spot-on brilliant, but here are some examples of the kind of things that we did to get FileMagnet up and running on Windows:</p>
<p>• Added unicode path support to the NSFileManager class.<br />
• Added support for displaying truncated strings.<br />
• Added support for drawing unicode strings.  (Not very pretty support.)<br />
• Fixed some issues with the NSSocket implementation.<br />
• Worked around or fixed a number of UI bugs. (It was similar to trying to get a Cocoa UI to look right in both OS X 10.4 and 10.5.)<br />
• Since Cocotron is not a complete implementation, we had to implement some methods ourselves, filling in the Windows implementation of the required Cocoa routines.  A few examples:<br />
   &#8211; [NSPropertyList dataFromPropertyList:] (for binary property lists)<br />
   &#8211; [NSImage TIFFRepresentation]<br />
   &#8211; [NSFileManager subpathsAtPath:]<br />
   &#8211; [NSWorkspace iconForFile:]<br />
   &#8211; [NSMutableString replaceOccurrencesOfString:withString:option:]<br />
• Additionally, Ken posted a few issues/requests to the <A HREF="http://groups.google.com/group/cocotron-dev/">Cocotron Google Group</A>, and the team responded amazingly fast; they even implemented some functionality that we needed.</p>
<p>Now that the app has shipped, we&#8217;ll be merging our additions and fixes back into the Cocotron project as soon as possible.</p>
<p>The primary shortcoming of the Cocotron project may be the lack of a flagship product to drive the effort.  It became apparent once we started the port, that the creators weren&#8217;t actively using it to create a shipping application.  For comparison, take the <a href="http://cappuccino.org/">Cappuccino</a> project.  They&#8217;re drinking their own Cocoa by using their new framework to make the awesome <a href="http://280slides.com/">280 Slides</a> presentation tool.  Cocotron desperately needs something in this vein to flush out bugs and unearth crucial but missing functionality.</p>
<p><b>I&#8217;m a PC</b></p>
<p>It&#8217;s true that we do build our app from Xcode, but we still needed to have Windows around for actually running, debugging and testing the app.  However, in this day and age you don&#8217;t need to hop to a different machine.  We simply used <A HREF="http://www.vmware.com/products/fusion/">VMware Fusion</A>.  </p>
<p>One unexpected bonus was the ability to do source-level debugging of our Cocotron app.  The website provides detailed step-by-step <A HREF="http://www.cocotron.org/Tools/Debugging/Insight-GDB">instructions</A> for installing Insight-GDB.  Once it&#8217;s all set up, just one click has you stepping through your Objective-C code on the Windows system.  You can even step into the Cocotron framework&#8217;s source.  (Don&#8217;t you wish you could do that with Cocoa?)</p>
<p>Also, I should point out that Windows users expect an installer, so you still do have to sit down on Windows and figure out how Windows installers and code signing work.  Finally, don&#8217;t forget to struggle through Vista compatibility.  Our app didn&#8217;t exactly work like a dream the first time we tried Vista.  In fact, it didn&#8217;t even install.</p>
<p><B>Cocotron Evolution</B></p>
<p>Today we asked Cocotron co-creator Chris Lloyd about what the team has in store for us:<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD><TD>&#8220;Cocotron development going forward will continue to focus on the needs of developers who use the project.  This will revolve around completion of the existing frameworks and the addition of more frameworks. Some of the larger pieces under active development are a complete high quality Quartz 2D (CoreGraphics) rasterizer, AppKit support on Linux via X11 and a Windows cross-debugger which works with Xcode. There has been interest and some work on CoreData so hopefully we can expand on that component too. The more people use it, report bugs and submit patches the better it will become.&#8221;</TD></TR></TABLE></p>
<p>It&#8217;s amazing what this team has been able to accomplish, and it sounds like they&#8217;ll continue to crank out new goodness.</p>
<p><b>In Conclusion</b></p>
<p>Good stuff, but be prepared to roll up your sleeves and join in the fun!  But as Geordi La Forge would say, you don&#8217;t have to take our word for it. Try it out yourself!  Our next Cocotron adventure will be a breeze now that we&#8217;ve fought through the jungle and know just what to expect.  Expect it to work, but don&#8217;t expect it to be super fun.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fmacdaddyworld.com%2F2008%2F10%2F27%2Fadventures-in-cocotron%2F';
  addthis_title  = 'Adventures+in+Cocotron';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://macdaddyworld.com/2008/10/27/adventures-in-cocotron/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Iron Coder Live: PoorLocation!</title>
		<link>http://macdaddyworld.com/2008/09/08/iron-coder-live-poorlocation/</link>
		<comments>http://macdaddyworld.com/2008/09/08/iron-coder-live-poorlocation/#comments</comments>
		<pubDate>Tue, 09 Sep 2008 02:49:03 +0000</pubDate>
		<dc:creator>glen</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[c4]]></category>
		<category><![CDATA[ironcoder]]></category>

		<guid isPermaLink="false">http://macdaddyworld.com/?p=93</guid>
		<description><![CDATA[We&#8217;re just back from C4[2].  Fantastic speakers and loads of Mac nerdery made for an amazing weekend trip to Chicago. The most unexpected part of the weekend for us was winning the Sunday contest.  Having won Iron Coder Live last year, we weren&#8217;t planning on entering again—that is, until we found out about [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://rentzsch.com/c4/twoOpen/"><img src="http://macdaddyworld.com/wp-content/uploads/2008/09/c4glasses.png" alt="" title="c4glasses" width="172" height="133" class="alignright size-full wp-image-114" /></a>We&#8217;re just back from <A HREF="http://rentzsch.com/c4">C4[2]</A>.  <A HREF="http://rentzsch.com/c4/twoOpen">Fantastic speakers</A> and loads of Mac nerdery made for an amazing weekend trip to Chicago. The most unexpected part of the weekend for us was winning the Sunday contest.  Having won Iron Coder Live <A HREF="http://www.engadget.com/2007/08/13/mirror-based-video-conferencing-developed-for-iphone/">last year</A>, we weren&#8217;t planning on entering again—that is, until we found out about the <A HREF="http://rentzsch.com/c4/2IronCoderPrizes">amazing prize package</A>.  If there&#8217;s anything you can never have enough of, it&#8217;s Macs&#8230; and software to load onto them.  If you weren&#8217;t there to watch, the entry is a bit difficult to describe but here goes.</p>
<p>In the spirit of the contest, we procrastinated until late Thursday afternoon and hatched a plan in a Starbucks-fueled brainstorm. (The employees at Starbucks are thoroughly convinced that we have no job.)</p>
<p>We had some Core Location-related ideas, but they would have involved lots of running around Chicago with iPhones, and since Wolf had given explicit permission to deviate from the theme &#8220;if the hack was cool enough&#8221;, we decided not to go the Core Location route.  Once we came up with the stupidest idea on the planet, we headed out to buy Radio Shack&#8217;s last four remaining infrared LEDs and some tiny calculator batteries.</p>
<p><img src="http://macdaddyworld.com/wp-content/uploads/2008/09/leds.jpg" alt="" title="LED and battery taped to iPhone" width="153" height="184" class="alignright size-medium wp-image-117" />Six hours later, we had our hack ready:  Using the <A HREF="http://sourceforge.net/projects/darwiin-remote/">WiiRemote.framework</A> and some Apple sample code, we created a Mac app which could track infrared light sources using a Bluetooth link to a Wii Remote to draw colorful lines on the Mac screen.  We also added an HTTP server using Cultured Code&#8217;s <A HREF="http://culturedcode.com/cocoa/">Simple HTTP Server</A> Cocoa project.  We then created an iPhone application to send HTTP requests to the Mac via Wifi.  These requests controlled what kind of &#8220;artwork&#8221; would be generated by the Mac application.  (Line color, thickness, etc.)  As a finishing touch, we taped the infrared LEDs and batteries to the front of the iPhone.  This allowed for a &#8220;digital whiteboard&#8221; effect.  By pressing button on the iPhone&#8217;s cool UI and waving it around in a drawing motion, we were able to paint designs in the Mac program.</p>
<p><img src="http://macdaddyworld.com/wp-content/uploads/2008/09/phoneapp1.png"/><img src="http://macdaddyworld.com/wp-content/uploads/2008/09/phoneapp2.png"/></p>
<p>Friday was something of a blur and no work happened on the hack.  I think I signed up for <A HREF="http://twitter.com/pimpinglen">Twitter</A> at some point.  Tweet.</p>
<p>Saturday afternoon, we decided that we needed a &#8220;clincher&#8221; feature.  A new mode was added to the application (using a UITabBarController of course) which allowed for the positioning and stamping of image files.  We also added iPhone X-axis accelerometer data to the mix to allow for rotating of the stamped images by simply twisting the iPhone.</p>
<p>The next 24 hours was spent trying to decide what images we would use.  We finally decided on Ken and Glen heads, tinfoil hats, nose glasses and fake moustaches, inspired by Josh and Dave&#8217;s <A HREF="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?mt=8&#038;id=284880416">Mr. Shuffle</A> app, and the &#8220;paranoia&#8221; theme.</p>
<p><IMG SRC="http://macdaddyworld.com/wp-content/uploads/2008/09/macapp.png"></p>
<p>After spending Sunday morning in Photoshop lassoing fake moustaches, the live demo was a complete disaster.  We positioned the Wii remote too far away from the Mac for the Bluetooth link to function, and our iPhones randomly jumped from out of our ad-hoc network to the conference network midway through the demo.  Much awkwardness was <A HREF="http://twitter.com/c4/statuses/913116184">twittered</A>.  </p>
<p>In the end, we somehow managed to take first place. Thanks for your votes, and thanks to all of the companies who donated software and t-shirts!</p>
<p>Here&#8217;s the <A HREF="http://macdaddyworld.com/wp-content/uploads/2008/09/poorlocation1.zip">source</A> (875k) for our hack including Mac and iPhone projects.  You&#8217;ll need Xcode 3.1, iPhone SDK and the <A HREF="http://sourceforge.net/projects/darwiin-remote/">WiiRemote.framework</A> if you would like to build it.  You&#8217;ll also need infrared LEDs&#8230; and tape&#8230;</p>
<p><I>Known issues:</I> HTTP did not prove to be the best way to send rapid-fire requests from the iPhone to the Mac.  The iPhone&#8217;s HTTP request system seems to freeze up if we send requests too quickly.  Also, the IP address of the Mac server is hardcoded into the iPhone app for extra credit laziness.  </p>
<p><i>One more thing:</i> This code was mashed together in a few hours, and just barely.  It contains some nasty bits and should not be used as an example of proper or efficient Cocoa programming!</p>
<p>So will anyone actually try this themselves?  Let us know if you do!</p>
<div id="attachment_132" class="wp-caption center" style="width: 510px"><a href="http://macdaddyworld.com/wp-content/uploads/2008/09/output.jpeg"><img src="http://macdaddyworld.com/wp-content/uploads/2008/09/output.jpeg" alt="Actual Program Output" title="Actual Program Output" width="500" height="389" class="size-full wp-image-132" /></a><p class="wp-caption-text">Actual Program Output</p></div>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fmacdaddyworld.com%2F2008%2F09%2F08%2Firon-coder-live-poorlocation%2F';
  addthis_title  = 'Iron+Coder+Live%3A+PoorLocation%21';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://macdaddyworld.com/2008/09/08/iron-coder-live-poorlocation/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Sneak Preview: iPhoneCam</title>
		<link>http://macdaddyworld.com/2008/01/12/sneak-preview-iphonecam/</link>
		<comments>http://macdaddyworld.com/2008/01/12/sneak-preview-iphonecam/#comments</comments>
		<pubDate>Sat, 12 Jan 2008 19:06:56 +0000</pubDate>
		<dc:creator>ken</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://macdaddyworld.com/2008/01/12/sneak-preview-iphonecam/</guid>
		<description><![CDATA[Abstract:
Use your iPhone&#8217;s camera as a wireless Mac webcam!  Stream video over Wi-Fi to any Mac video application such as iChat, Photo Booth or Skype.Some History:
After the C4 Iron Coder contest where we made the video conferencing iPhone app, we put down our iPhones and got back to writing Mac software for the rest [...]]]></description>
			<content:encoded><![CDATA[<p><b>Abstract:</b></p>
<p>Use your iPhone&#8217;s camera as a wireless Mac webcam!  Stream video over Wi-Fi to any Mac video application such as iChat, Photo Booth or Skype.<br /><img src='http://macdaddyworld.com/wp-content/uploads/2008/01/meekus.thumbnail.jpg' alt='meekus.jpg' class="alignright" /><br /><b>Some History:</b></p>
<p>After the <a href="http://rentzsch.com/c4/">C4</a> Iron Coder contest where we made the <a href="http://macdaddyworld.com/2007/08/15/hooray-for-sample-app/">video conferencing iPhone app</a>, we put down our iPhones and got back to writing <a href="http://www.ecamm.com/">Mac software</a> for the rest of year.  Nobody knew, and we still don&#8217;t know, what the future of these iPhone apps would and will hold.</p>
<p>Last week I had a strange urge to get back on the iPhone again and solve some problems that had left us stumped this summer.  More specifically, I wanted to get <b>streaming video from the camera</b>. (If you remember our video demo at C4, the frame rate was quite low. This was because, under the strict time limit of the conferece, we weren&#8217;t able to grab from the camera any faster than a frame or two per second.)</p>
<p><b>Meet iPhoneCam:</b></p>
<table align=right border=0 width=128 hspace=10>
<tr>
<td><a target="_new" href="http://www.youtube.com/watch?v=XnNcsdAmpaA"><img src='http://macdaddyworld.com/wp-content/uploads/2008/01/clipping.thumbnail.jpg' alt='clipping' / BORDER=0></a></td>
</tr>
<tr>
<td><font size=-2>Click to <A target="_new" HREF="http://www.youtube.com/watch?v=XnNcsdAmpaA">download a recording</A> of an iChat video conference where I demo it to Glen.  </font></td>
</tr>
</table>
<p>I figured it out: Now we can stream at up to 30 fps.  My proof-of-concept is an iPhone app which <b>streams video over Wi-Fi</b> to a video driver component on the Mac.  This way, you can use the iPhone&#8217;s camera stream in any Mac video program like iChat, Photo Booth or Skype.  </p>
<p>Using <a href="http://www.ecamm.com/mac/ichatusbcam/">iChatUSBCam</a> (so that iChat can see non-iSight video sources), I did a video conference with Glen to show him how it looks.  He recorded it with <a href="http://www.ecamm.com/mac/conferencerecorder/">Conference Recorder</a> so that we could share it on the blog. You can <a target="_new" href="http://www.youtube.com/watch?v=XnNcsdAmpaA">download a demo video here</a>.</p>
<p>But I haven&#8217;t gotten to the clever bit yet. </p>
<p><b>The Clever Bit:</b></p>
<p><img src='http://macdaddyworld.com/wp-content/uploads/2008/01/images.jpeg' alt='bonjour' class="alignright"/>The iPhone app and the Mac component find each other using Bonjour (zeroconf).  There&#8217;s absolutely no configuration necessary.  If there&#8217;s an iPhone-based camera available, the Mac finds it and uses it automatically.  Glen had the idea to see if Bonjour could be used, and we noticed that <a href="http://poly.share.dj/wiki/index.php/Bonjour">IDMResearch</a> had already provided a nice wrapper around CFNetService.</p>
<p>FAA: (Frequently Answered Answers)</p>
<p>A: No, it only streams video.</p>
<p>A: No, it&#8217;s only for Mac users.</p>
<p>A: iPhoneCam is not yet available to download. We&#8217;ll have something for folks to try soon.  Stop by <A HREF="http://www.ecamm.com/mwsf08/">our booth at MacWorld Expo</A> and maybe we can give you a live demo!</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fmacdaddyworld.com%2F2008%2F01%2F12%2Fsneak-preview-iphonecam%2F';
  addthis_title  = 'Sneak+Preview%3A+iPhoneCam';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://macdaddyworld.com/2008/01/12/sneak-preview-iphonecam/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>iGlasses 2 Retrospective</title>
		<link>http://macdaddyworld.com/2007/09/08/iglasses-2-retrospective/</link>
		<comments>http://macdaddyworld.com/2007/09/08/iglasses-2-retrospective/#comments</comments>
		<pubDate>Sat, 08 Sep 2007 15:58:09 +0000</pubDate>
		<dc:creator>ken</dc:creator>
				<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[updates]]></category>

		<guid isPermaLink="false">http://macdaddyworld.com/?p=40</guid>
		<description><![CDATA[After a very long development cycle, we released iGlasses 2 on August 27th.  The new version has so many exciting new features; my favorite being the ability to digitally pan and zoom your camera (and even cooler, this can be accomplished using the Apple Remote!).  Another really nice feature is the precise control [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/macdaddyworld/1347212206/" title="Glen as evil mastermind"><img src="http://farm2.static.flickr.com/1380/1347212206_0ecea67c0f_m.jpg" width="240" height="240" alt="Glen as evil mastermind" class=alignright /></a>After a very long development cycle, we released <a href="http://www.ecamm.com/mac/iglasses/">iGlasses 2</a> on August 27th.  The new version has so many exciting new features; my favorite being the ability to digitally pan and zoom your camera (and even cooler, this can be accomplished using the Apple Remote!).  Another really nice feature is the precise control over the built-in iSight&#8217;s brightness and the ability to lock the iSight&#8217;s auto exposure.</p>
<p>Amazingly, we&#8217;ve had only a few bug reports and they are very minor problems.  With software, major updates are usually followed by a point release udpate in less than 48 hours. (I&#8217;m looking at you iTunes.) Not so with iGlasses 2.  However, iGlasses 2.0.1 will be coming at some point to fix those minor issues.</p>
<p><img src="http://ecamm.com/mac/iglasses/remote.jpg" class=alignleft> Probably the worst bug is that iGlasses 2 causes a crash for 10.3.9 users when they run the Bruji apps (DVDPedia, BookPedia, etc.)  We always feel terrible when our plugins cause pain to other developers.  We do try to test every situation and we do run a beta progam but somehow we missed this one.  The cause of the crash is interesting:</p>
<h3>Watch out for duplicate class names</h3>
<p>It&#8217;s a rare problem, but you can run into duplicate Objective-C class names when the dynamic linker is loading bundles at run-time.  It turns out that iGlasses and __Pedia both used the excellent and free <a href="http://martinkahr.com/source-code/">AppleRemote library by Martin Kahr</a>.  It&#8217;s an Obj-C class wrapper around the Apple Remote, which makes it really simple to use a remote in your app.  Since neither Bruji nor iGlasses changed the name of the class, the dynamic linker gets an error when trying to load iGlasses.  </p>
<p>Now, typically, this won&#8217;t cause a crash. The linker will print an error message and then continue, using only one of the two available classes.  (This would cause immediate problems if the two classes were actually different internally.)  Even though these two classes were probably identical, in this case 10.3.9 doesn&#8217;t deal with it so well.  This is what we found in the system.log (absolute pathnames and other nonsense removed for readability):</p>
<blockquote><p>
Bookpedia: objc: Both Pediabase and iGlasses have implementations of class AppleRemote.<br />
Bookpedia: objc: Using implementation from iGlasses.<br />
Bookpedia: objc: thread is already initializing this class!<br />
crashdump: Started writing crash report to: Bookpedia.crash.log<br />
</blockquote >
<p>Yikes! The lesson?  NEVER use simple class names!  Always use some unique company or library prefix, even for classes you&#8217;re borrowing! <img src='http://macdaddyworld.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>The easiest thing to do in this case is to just use a macro in your prefix file like this:</p>
<blockquote><p>#define AppleRemote ECAppleRemote</p></blockquote>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fmacdaddyworld.com%2F2007%2F09%2F08%2Figlasses-2-retrospective%2F';
  addthis_title  = 'iGlasses+2+Retrospective';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://macdaddyworld.com/2007/09/08/iglasses-2-retrospective/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hooray for Sample App</title>
		<link>http://macdaddyworld.com/2007/08/15/hooray-for-sample-app/</link>
		<comments>http://macdaddyworld.com/2007/08/15/hooray-for-sample-app/#comments</comments>
		<pubDate>Wed, 15 Aug 2007 23:30:06 +0000</pubDate>
		<dc:creator>glen</dc:creator>
				<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://macdaddyworld.com/?p=39</guid>
		<description><![CDATA[Due to popular demand, we&#8217;ve created a sample application based on our C4 Iron Coder Live contest entry.  Here&#8217;s what you&#8217;ll need to run this:
Required:
1) A jail-broken iPhone, ideally activated.
2) A Wifi connection
3) Knowledge about how to install 3rd-party native iPhone applications.
4) A friend with (1)-(3) above.
Recommended:
5) A periscope mirror that reflects your iPhone [...]]]></description>
			<content:encoded><![CDATA[<p>Due to popular demand, we&#8217;ve created a sample application based on our <a href="http://c4.rentzsch.com/1/">C4</a> <a href="http://rentzsch.com/c4/ironCoderLive">Iron Coder Live</a> <a href="http://macdaddyworld.com/?p=38">contest entry</a>.  Here&#8217;s what you&#8217;ll need to run this:</p>
<p><B>Required:</B><br />
1) A <a href="http://iphone.fiveforty.net/wiki/index.php/How_to_Escape_Jail">jail-broken</a> iPhone, ideally activated.<br />
2) A Wifi connection<br />
3) Knowledge about <a href="http://www.jeremyjohnstone.com/blog/archives/2007/08/05/howto-run-custom-apps-on-iphone-part-2/">how to install 3rd-party native iPhone applications</a>.<br />
4) A <a href="http://www.friendster.com/">friend</a> with (1)-(3) above.</p>
<p><B>Recommended:</B><br />
5) A periscope mirror that reflects your iPhone camera image 180&deg;.</p>
<p>It should also be mentioned that we cannot provide any technical help with getting this running.  If you think you&#8217;ve found a bug, we&#8217;d love to hear about it.</p>
<p><IMG SRC="/meekus.jpg" class=alignright></p>
<p><B>Privacy Disclaimer:</B><br />
<small>This application uses a central server to move images between two iPhones, using your iPhone&#8217;s phone number as your unique ID.  (It&#8217;s your &#8220;screen name&#8221; if you like.)  Therefore, if you&#8217;re not comfortable broadcasting your phone number and your camera images through our server, this may not be the app for you.  (No, we&#8217;re not going to call you, distribute your phone number, or spy on you.) Also, there&#8217;s no authentication or any way to keep anyone who knows your number from viewing your images.</small></p>
<p>Oh yeah, here&#8217;s the link:  <A HREF="/squidge_app.zip">squide_app.zip</A> (38K)</p>
<p>Have fun!</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fmacdaddyworld.com%2F2007%2F08%2F15%2Fhooray-for-sample-app%2F';
  addthis_title  = 'Hooray+for+Sample+App';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://macdaddyworld.com/2007/08/15/hooray-for-sample-app/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Two-way Video Conferencing for iPhone</title>
		<link>http://macdaddyworld.com/2007/08/12/two-way-video-conferencing-for-iphone/</link>
		<comments>http://macdaddyworld.com/2007/08/12/two-way-video-conferencing-for-iphone/#comments</comments>
		<pubDate>Sun, 12 Aug 2007 08:13:51 +0000</pubDate>
		<dc:creator>glen</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://macdaddyworld.com/?p=38</guid>
		<description><![CDATA[in which we make the world&#8217;s first useful video phone

Update: Our demo won first place for Iron Coder Live this afternoon! Thanks for your votes everyone!
Update 2: We&#8217;ve added a link to source code at the bottom of the post.   We also made a quick video demo in Starbucks today.

&#160;&#160;&#160;This weekend&#8217;s C-4 developer [...]]]></description>
			<content:encoded><![CDATA[<p><em>in which we make the world&#8217;s first useful video phone</em></p>
<p><HR></p>
<p><b>Update:</b> Our demo won first place for Iron Coder Live this afternoon! Thanks for your votes everyone!</p>
<p><B>Update 2:</B> We&#8217;ve added a link to source code at the bottom of the post.   We also made a quick <A HREF="http://www.youtube.com/watch?v=iew4rXsorTw">video demo</A> in Starbucks today.</p>
<p><HR><br />
<TABLE BORDER=0 ALIGN=right CELLPADDING=0 CELLSPACING=0><TR><TD>&nbsp;&nbsp;&nbsp;</TD><TD><a href="http://c4.rentzsch.com/1/"><img src="/c4-128.png" WIDTH=65 alt="" BORDER=0/></a></TD></TR></TABLE>This weekend&#8217;s <a href="http://c4.rentzsch.com/1/">C-4</a> developer conference features &#8220;Iron Coder Live&#8221;, a contest in the same vein as <a href="http://www.machack.com/">MacHack</a>.  The event encourages conference attendees to develop creative &#8220;hacks&#8221;, written in within a short timeframe.  This year&#8217;s theme, of course, is iPhone.  </p>
<p>This was a great excuse to buy another iPhone, install the <a href="http://iphone.fiveforty.net/wiki/index.php/Toolchain_Project">iPhone toolchain</a> and waste some time!  Before we knew it, the iCal told us it was Thursday and we were putting the finishing touches on iPhone video conferencing.</p>
<p><CENTER><IMG SRC="/justus.jpg"></CENTER></p>
<p><strong>Camera?  Oh really?</strong></p>
<p>Obviously we had to do something with the iPhone&#8217;s camera.  Doing crazy things with cameras <a href="http://www.ecamm.com/mac/imagewebcam/">is</a> <a href="http://www.ecamm.com/mac/iglasses/">a</a> <a href="http://www.ecamm.com/mac/ichatusbcam/">full</a> <a href="http://www.ecamm.com/mac/huckleberry/">time</a> <a href="http://www.ecamm.com/mac/callrecorder/">job</a> for us!  Our contest entry captures video from the iPhone&#8217;s camera, compresses it, and sends it to a web server, where it&#8217;s relayed to another iPhone, and vice-versa, resulting in a nice two-way video conference.  Need audio too?  That&#8217;s not our department but simply make a phone call to the other person&#8217;s iPhone and put them on speaker phone.  Then fire up our program and you&#8217;re in business.  (Yes, the iPhone makes phone calls apparently.)</p>
<p><strong>Wait for the Clever Bit</strong></p>
<p>Now you&#8217;re probably thinking, how do you do a video conference when the iPhone&#8217;s camera is pointed in the wrong direction?  The iPhone, like every other smartphone that I&#8217;ve seen, has a camera mounted on the back of the device, causing most people to dismiss the possibility of video conferencing right out of the gate.</p>
<p><strong>Phuckleberry</strong></p>
<p>For those of you familiar with the Ecamm product line, you may remember that we sell the <a href="http://www.ecamm.com/mac/huckleberry/">Huckleberry mirror</a>, a periscope for your MacBook or MacBook Pro.  While the Huckleberry II for MacBook Pro doesn&#8217;t quite fit properly on an iPhone, that&#8217;s nothing some wire cutters and imagination couldn&#8217;t fix.  Here are some pictures of our homemade iPhone-Huckleberry-stand running a two-way video conference over wifi.  As you can see, the camera image is reflected off two acrylic mirrors and re-oriented in software.</p>
<p><IMG SRC="/hand1.jpg"><br />
<IMG SRC="/hand2.jpg"><br />
<IMG SRC="/twotable.jpg"><br />
(The orientation changes automatically of course.)</p>
<p><strong>Darn</strong></p>
<p>Ok, whoops, we meant to create something useless and fun.  Surprisingly, this actually works very well, and might be considered downright useful in some scenarios.  I hope that doesn&#8217;t disqualify us from the hack contest&#8230;</p>
<p><strong>The iPhone Toolchain</strong></p>
<p>The first step after <a href="http://iphone.fiveforty.net/wiki/index.php/How_to_Escape_Jail">jailbreaking</a> our iPhones (which sounds dangerous but is actually pretty benign), was downloading and building the iPhone toolchain.  The toolchain is clearly the result of hundreds of hours of work by a devoted group of iPhone dev devotees.  What have they built?  In a Nutshell, devs can now write native iPhone apps in the same integrated development environment we use to write Mac apps, in the same programming lanaguage, using <strong>almost</strong> the same set of APIs.  It&#8217;s pretty overwhelming to think of the possibilites this opens up.  It&#8217;s like a tiny little Mac/phone just like we were all promised!  Thanks to the folks at <a href="http://iphone.fiveforty.net/wiki/index.php?title=Main_Page">iPhone Dev Wiki</a>, and the <a href="http://developer.berlios.de/projects/iphone-binutils/">binutils</a> project, and these <a href="http://ellkro.jot.com/iPhoneHacking">two</a> <a href="http://www.jeremyjohnstone.com/blog/archives/2007/08/05/howto-run-custom-apps-on-iphone-part-1/">pages</a> for getting us up and running within hours.</p>
<p><strong>Source Code</strong></p>
<p>We&#8217;ve decided to post the source code for our contest entry here on the blog.  Please keep in mind, this is most likely not going to be useful to you for anything other than illustrating the mechanisms that we used to accomplish our hack.  The current app does not support more than two users, and will not just compile and magically work, as you will also need a server and a relay script to send the imagery between iPhones.  (We used Perl for that.) </p>
<p>Download here: <a href="/squidge_source.zip">squidge_source.zip</a> (84K)</p>
<p><strong>Sample App</strong></p>
<p>Next on our list, we&#8217;ll be creating an app that will actually let ambitious iPhone users try out the proof of concept.  This primarily involves adding a user interface.  Check back for this.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fmacdaddyworld.com%2F2007%2F08%2F12%2Ftwo-way-video-conferencing-for-iphone%2F';
  addthis_title  = 'Two-way+Video+Conferencing+for+iPhone';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://macdaddyworld.com/2007/08/12/two-way-video-conferencing-for-iphone/feed/</wfw:commentRss>
		<slash:comments>169</slash:comments>
		</item>
		<item>
		<title>iPhoneDrive</title>
		<link>http://macdaddyworld.com/2007/07/10/iphonedrive/</link>
		<comments>http://macdaddyworld.com/2007/07/10/iphonedrive/#comments</comments>
		<pubDate>Wed, 11 Jul 2007 00:48:23 +0000</pubDate>
		<dc:creator>ken</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Objective-C]]></category>

		<guid isPermaLink="false">http://macdaddyworld.com/?p=26</guid>
		<description><![CDATA[
We just finished some marathon coding and are happy to announce iPhoneDrive.  In a nutshell, it lets you use your iPhone for file storage by providing an easy file browser interface.  Version 1.0 is very functional considering that it was written in about one week.  The demo version works just like the [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://macdaddyworld.com/wp-content/uploads/2007/07/iphonedisk.png' alt='iPhoneDrive' class=alignright /><br />
<strong>We just finished some marathon coding and are happy to announce <a href="http://www.ecamm.com/mac/iphonedrive">iPhoneDrive</a>.</strong>  In a nutshell, it lets you use your iPhone for file storage by providing an easy file browser interface.  Version 1.0 is very functional considering that it was written in about one week.  The <a href="http://www.ecamm.com/mac/iphonedrive/iPhoneDrive.zip">demo version</a> works just like the <a href="https://www.ecamm.com/cgi-bin/shopping/cart?p=iphonedrive">paid version</a> but only for a 7 day period.</p>
<p>It supports drag and drop to and from the iPhone.  It also supports transfer of entire folders.  This makes it easy to move large directories back and forth between your Mac and your iPhone.  Since the iPhone uses USB 2.0, the transfer speed is very fast.  Now you can put those spare gigabytes to good use. Backup your important files! Your hard disk could fail at any moment! Do it now!</p>
<p>Here&#8217;s a screenshot:<br />
<img src='http://macdaddyworld.com/wp-content/uploads/2007/07/screen.jpg' alt='iPhoneDrive'/></p>
<p><strong>Reinventing the Wheel</strong></p>
<p><img src='http://macdaddyworld.com/wp-content/uploads/2007/07/revopower.thumbnail.jpg' alt='Reinventing' class=alignright />You can see we used an NSBrowser for the file browser.  If you&#8217;ve ever tried to use one of these you&#8217;d know that they&#8217;re not very useful out of the box. Drag and drop has to be implemented manually, and the updating of cell data is very flaky, requiring many work-arounds. Also, they don&#8217;t do many of the things that you&#8217;d come to expect from the Finder&#8217;s column view mode.</p>
<p>All said and done, the interface came out pretty good.  I just wish Apple would update NSBrowser to support more of the things found in the Finder column view.  Obviously the Finder isn&#8217;t implemented using NSBrowser (it&#8217;s not even Cocoa for that matter), but it would be nice to have things like elipsification, marquee selecting, and drag and drop in there without having to reinvent the wheel.  </p>
<p>We welcome any feedback about iPhoneDrive. Leave a comment here or use the feedback form on the main Ecamm website.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fmacdaddyworld.com%2F2007%2F07%2F10%2Fiphonedrive%2F';
  addthis_title  = 'iPhoneDrive';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://macdaddyworld.com/2007/07/10/iphonedrive/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Apple&#8217;s Secret Button &#8211; Cocoa on Windows?</title>
		<link>http://macdaddyworld.com/2007/06/22/apples-secret-button-cocoa-on-windows/</link>
		<comments>http://macdaddyworld.com/2007/06/22/apples-secret-button-cocoa-on-windows/#comments</comments>
		<pubDate>Fri, 22 Jun 2007 14:59:20 +0000</pubDate>
		<dc:creator>ken</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Objective-C]]></category>

		<guid isPermaLink="false">http://macdaddyworld.com/?p=7</guid>
		<description><![CDATA[Safari 3 on Windows is old news by now, but I still have this nagging feeling.  
Apple has had iTunes on Windows for years, but iTunes is a Carbon app, and doesn&#8217;t contain any Cocoa, AppKit, or Objective-C. (A quick analysis with otool will show this.)
I&#8217;m not saying that getting iTunes ported to the [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://macdaddyworld.com/wp-content/uploads/2007/06/images.jpg' alt='Easy' class="alignright"/>Safari 3 on Windows is old news by now, but I still have this nagging feeling.  </p>
<p>Apple has had iTunes on Windows for years, but iTunes is a Carbon app, and doesn&#8217;t contain any Cocoa, AppKit, or Objective-C. (A quick analysis with otool will show this.)<br />
I&#8217;m not saying that getting iTunes ported to the PC was easy, but it&#8217;s not exciting because we don&#8217;t write Carbon apps anymore.</p>
<p>Now enter Safari for Windows&#8230;  Safari is written from the ground up in Cocoa.  A quick analysis of Safari will show you that it contains over 200 Obj-C classes and about 4000 Obj-C methods.  Its controllers (logic) and views (the UI) are built entirely in Objective-C using AppKit.  </p>
<p>Why is this an important fact?</p>
<p>I&#8217;m a huge fan of Cocoa and coding using AppKit:  I find it makes coding fast and efficient. The only downside?  Without a huge nasty porting effort, your code is permanently stuck on the Mac.  All of your <code>NSMutableDictionary</code>, all of your <code>NSWorkspace</code>, all of your <code>NSLock</code>, all of your <code>NS</code>-<em>anything</em>. Today, it&#8217;s just not leaving your Mac.  It&#8217;s stuck.</p>
<p>I&#8217;d really like to port <a href="http://www.ecamm.com/mac/cardraider/">CardRaider</a> to Windows, but it makes such heavy use of Objective-C and AppKit, that it just seems like a nasty task.  </p>
<p>Now enter Safari on Windows.  Cursory examinations of the Safari 3 Windows binaries shows no evidence of an Objective-C runtime or any AppKit.dll.  So let&#8217;s assume for a moment that they didn&#8217;t just port the Cocoa and AppKit libraries&#8230;<br />
So did Apple really rewrite all 200 Obj-C classes in Safari in C++ or C# and change them to not use Cocoa?  Are they somehow going to maintain two codebases, one written entirely in Obj-C based on AppKit, and one in another language and based some other library?  Maybe they did&#8230; they seem to have done that with WebKit and WebCore&#8230;.</p>
<p>Or, more likely, <strong>do they have some kind of secret button</strong> (some kind of tool, script, or compiler modification) that takes Safari&#8217;s 200 .m files and makes Windows code.  </p>
<p>I&#8217;m not trying to trivialize their porting effort, because I&#8217;m sure it wasn&#8217;t an easy task. I&#8217;m just looking at the implications of maintaining two mostly identical versions of Safari 3, one written in Objective-C  using Cocoa, and the other not allowed to use those things.  </p>
<p>Did they really port this manually? I don&#8217;t think so.<br />
<code>otool -ov /Applications/Safari.app/Contents/MacOS/Safari | grep -c Module<br />
202<br />
otool -ov /Applications/Safari.app/Contents/MacOS/Safari | grep -c method_name<br />
4097<br />
otool -tV /Applications/Safari.app/Contents/MacOS/Safari | grep -c _objc_msgSend<br />
20319<br />
</code><br />
I hope for their sakes that it&#8217;s somehow automated, and if it is&#8230;</p>
<p>Apple: Share the technology!<br />
Give developers the secret button to easily make their Cocoa apps into Windows apps!</p>
<blockquote><p>Can you think of anything that could do more to encourage Mac development than allowing that code to also be useful for Windows?</p></blockquote>
<p><em>But maybe they really did port it line by line, class by class.<br />
</em>If you look at the Windows branch of WebKit/WebCore, all the .m files have become .cpp files and the AppKit calls have become CoreFoundation calls. And it shows no sign of having been automated.<br />
And a lot of the code has clearly been manually ported to Windows code. For example looking at a randomly selected class/routine:</p>
<p>The once graceful:<br />
<code>-[WebIconDatabase  iconForURL:withSize:cache:]<br />
</code><br />
has become:<br />
<code>HRESULT WebIconDatabase::iconForURL(BSTR url, LPSIZE size, BOOL cache,  OLE_HANDLE* bitmap)<br />
</code></p>
<p>with the underlying <code>NSWorkspace</code>, <code>NSImage</code>, <code>NSMutableDictionary</code>, etc. calls now turned into  dirty Windows <code>CreateDIBSection</code> code.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fmacdaddyworld.com%2F2007%2F06%2F22%2Fapples-secret-button-cocoa-on-windows%2F';
  addthis_title  = 'Apple%26%238217%3Bs+Secret+Button+%26%238211%3B+Cocoa+on+Windows%3F';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://macdaddyworld.com/2007/06/22/apples-secret-button-cocoa-on-windows/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

