<?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>Kevin McMahon &#187; Documentation</title>
	<atom:link href="http://blog.kevfoo.com/index.php/tag/documentation/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.kevfoo.com</link>
	<description>The weblog of a Chicago based .Net and iPhone developer.</description>
	<lastBuildDate>Fri, 27 Aug 2010 15:00:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Monotouch Binding Gotcha</title>
		<link>http://blog.kevfoo.com/index.php/2010/02/monotouch-binding-gotcha/</link>
		<comments>http://blog.kevfoo.com/index.php/2010/02/monotouch-binding-gotcha/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 03:51:54 +0000</pubDate>
		<dc:creator>Kevin McMahon</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Api]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[Interface]]></category>
		<category><![CDATA[Mistake]]></category>
		<category><![CDATA[Objective C]]></category>
		<category><![CDATA[Subtle Gotcha]]></category>

		<guid isPermaLink="false">http://blog.kevfoo.com/?p=140</guid>
		<description><![CDATA[I stumbled across a subtle gotcha while exploring binding Objective-C types in MonoTouch.&#160; As luck would have it, someone else did also and posted a question about it on the MonoTouch IRC channel.&#160; The poster of the question eventually came across the answer and shared it there, and I am going to post it here [...]]]></description>
			<content:encoded><![CDATA[<p>I stumbled across a subtle gotcha while exploring binding Objective-C types in <a href="http://monotouch.net/">MonoTouch</a>.&#160; As luck would have it, someone else did also and posted a question about it on the <a href="http://monotouch.net/Chat">MonoTouch IRC channel</a>.&#160; The poster of the question eventually came across the answer and shared it there, and I am going to post it here in case anyone else makes the same mistake and is looking for some answers.</p>
<p>I was following along with the documentation for <a href="http://monotouch.net/Documentation/Binding_New_Objective-C_Types">binding new Objective-C types</a> on the MonoTouch site, and as a way to ease into the binding process, I chose a class to define from the CloudMade SDK that I am looking to expose in MonoTouch.&#160; The class selected was the BBox class (<a href="http://developers.cloudmade.com/repositories/entry/iphone-api/iphone-api/trunk/inc/CloudMade/bbox.h">bbox.h</a>) and I went about creating the following API definition shown below:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:32446696-877b-4dce-94d1-62a9f74add99" class="wlWriterEditableSmartContent">
<pre style="background-color:#FFFFFF;white-space:-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word;overflow: auto;"><span style="color: #0000FF;">using</span><span style="color: #000000;"> System;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> MonoTouch.Foundation;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> MonoTouch.ObjCRuntime;

</span><span style="color: #0000FF;">namespace</span><span style="color: #000000;"> CloudMade
{
    [BaseType(</span><span style="color: #0000FF;">typeof</span><span style="color: #000000;"> (NSObject))]
    </span><span style="color: #0000FF;">interface</span><span style="color: #000000;"> BBox
    {
        [Export(</span><span style="color: #800000;">"</span><span style="color: #800000;">westernLongitude</span><span style="color: #800000;">"</span><span style="color: #000000;">)]
        </span><span style="color: #0000FF;">float</span><span style="color: #000000;"> WesternLongitude {</span><span style="color: #0000FF;">get</span><span style="color: #000000;">;</span><span style="color: #0000FF;">set</span><span style="color: #000000;">;}

        [Export(</span><span style="color: #800000;">"</span><span style="color: #800000;">southernLatitude</span><span style="color: #800000;">"</span><span style="color: #000000;">)]
        </span><span style="color: #0000FF;">float</span><span style="color: #000000;"> SouthernLatitude {</span><span style="color: #0000FF;">get</span><span style="color: #000000;">;</span><span style="color: #0000FF;">set</span><span style="color: #000000;">;}

        [Export(</span><span style="color: #800000;">"</span><span style="color: #800000;">easternLongitude</span><span style="color: #800000;">"</span><span style="color: #000000;">)]
        </span><span style="color: #0000FF;">float</span><span style="color: #000000;"> EasternLongitude {</span><span style="color: #0000FF;">get</span><span style="color: #000000;">;</span><span style="color: #0000FF;">set</span><span style="color: #000000;">;}

        [Export(</span><span style="color: #800000;">"</span><span style="color: #800000;">northerLatitude</span><span style="color: #800000;">"</span><span style="color: #000000;">)]
        </span><span style="color: #0000FF;">float</span><span style="color: #000000;"> NorthernLatitude {</span><span style="color: #0000FF;">get</span><span style="color: #000000;">;</span><span style="color: #0000FF;">set</span><span style="color: #000000;">;}

        [Export(</span><span style="color: #800000;">"</span><span style="color: #800000;">asString</span><span style="color: #800000;">"</span><span style="color: #000000;">)]
        </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> AsString();
    }
}</span></pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<div>Once completed, I saved it as BBox.cs and attempted to generate the bindings by invoking btouch on the file.&#160; You can see below the unsuccessful message I received. </div>
<div>&#160;</div>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:ded3f3e2-df9d-45b8-84f8-1be4953cd47a" class="wlWriterEditableSmartContent">
<pre style="background-color:#FFFFFF;white-space:-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; word-wrap: break-word;overflow: auto;"><span style="color: #000000;">$</span><span style="color: #000000;"> btouch BBox</span><span style="color: #000000;">.</span><span style="color: #000000;">cs
</span><span style="color: #000000;">/</span><span style="color: #000000;">var</span><span style="color: #000000;">/</span><span style="color: #000000;">folders</span><span style="color: #000000;">/</span><span style="color: #000000;">E4</span><span style="color: #000000;">/</span><span style="color: #000000;">E44PAZnZGKGpVrmseo2N3</span><span style="color: #000000;">++++</span><span style="color: #000000;">TI</span><span style="color: #000000;">/</span><span style="color: #000000;">-Tmp-</span><span style="color: #000000;">/</span><span style="color: #000000;">9qgrm9nm</span><span style="color: #000000;">.</span><span style="color: #000000;">lnv</span><span style="color: #000000;">/</span><span style="color: #000000;">CloudMade</span><span style="color: #000000;">/</span><span style="color: #000000;">BBox</span><span style="color: #000000;">.</span><span style="color: #000000;">g</span><span style="color: #000000;">.</span><span style="color: #000000;">cs</span><span style="color: #000000;">(</span><span style="color: #000000;">46</span><span style="color: #000000;">,</span><span style="color: #000000;">71</span><span style="color: #000000;">)</span><span style="color: #000000;">: error CS0117: `CloudMade</span><span style="color: #000000;">.</span><span style="color: #000000;">BBox' does </span><span style="color: #0000FF;">not</span><span style="color: #000000;"> contain a definition </span><span style="color: #0000FF;">for</span><span style="color: #000000;"> `Messaging'
</span><span style="color: #000000;">/</span><span style="color: #000000;">var</span><span style="color: #000000;">/</span><span style="color: #000000;">folders</span><span style="color: #000000;">/</span><span style="color: #000000;">E4</span><span style="color: #000000;">/</span><span style="color: #000000;">E44PAZnZGKGpVrmseo2N3</span><span style="color: #000000;">++++</span><span style="color: #000000;">TI</span><span style="color: #000000;">/</span><span style="color: #000000;">-Tmp-</span><span style="color: #000000;">/</span><span style="color: #000000;">9qgrm9nm</span><span style="color: #000000;">.</span><span style="color: #000000;">lnv</span><span style="color: #000000;">/</span><span style="color: #000000;">CloudMade</span><span style="color: #000000;">/</span><span style="color: #000000;">BBox</span><span style="color: #000000;">.</span><span style="color: #000000;">g</span><span style="color: #000000;">.</span><span style="color: #000000;">cs</span><span style="color: #000000;">(</span><span style="color: #000000;">28</span><span style="color: #000000;">,</span><span style="color: #000000;">30</span><span style="color: #000000;">)</span><span style="color: #000000;">: </span><span style="color: #000000;">(</span><span style="color: #000000;">Location of the symbol related to previous error</span><span style="color: #000000;">)</span><span style="color: #000000;">
</span><span style="color: #000000;">/</span><span style="color: #000000;">var</span><span style="color: #000000;">/</span><span style="color: #000000;">folders</span><span style="color: #000000;">/</span><span style="color: #000000;">E4</span><span style="color: #000000;">/</span><span style="color: #000000;">E44PAZnZGKGpVrmseo2N3</span><span style="color: #000000;">++++</span><span style="color: #000000;">TI</span><span style="color: #000000;">/</span><span style="color: #000000;">-Tmp-</span><span style="color: #000000;">/</span><span style="color: #000000;">9qgrm9nm</span><span style="color: #000000;">.</span><span style="color: #000000;">lnv</span><span style="color: #000000;">/</span><span style="color: #000000;">CloudMade</span><span style="color: #000000;">/</span><span style="color: #000000;">BBox</span><span style="color: #000000;">.</span><span style="color: #000000;">g</span><span style="color: #000000;">.</span><span style="color: #000000;">cs</span><span style="color: #000000;">(</span><span style="color: #000000;">57</span><span style="color: #000000;">,</span><span style="color: #000000;">71</span><span style="color: #000000;">)</span><span style="color: #000000;">: error CS0117: `CloudMade</span><span style="color: #000000;">.</span><span style="color: #000000;">BBox' does </span><span style="color: #0000FF;">not</span><span style="color: #000000;"> contain a definition </span><span style="color: #0000FF;">for</span><span style="color: #000000;"> `Messaging'
</span><span style="color: #000000;">/</span><span style="color: #000000;">var</span><span style="color: #000000;">/</span><span style="color: #000000;">folders</span><span style="color: #000000;">/</span><span style="color: #000000;">E4</span><span style="color: #000000;">/</span><span style="color: #000000;">E44PAZnZGKGpVrmseo2N3</span><span style="color: #000000;">++++</span><span style="color: #000000;">TI</span><span style="color: #000000;">/</span><span style="color: #000000;">-Tmp-</span><span style="color: #000000;">/</span><span style="color: #000000;">9qgrm9nm</span><span style="color: #000000;">.</span><span style="color: #000000;">lnv</span><span style="color: #000000;">/</span><span style="color: #000000;">CloudMade</span><span style="color: #000000;">/</span><span style="color: #000000;">BBox</span><span style="color: #000000;">.</span><span style="color: #000000;">g</span><span style="color: #000000;">.</span><span style="color: #000000;">cs</span><span style="color: #000000;">(</span><span style="color: #000000;">28</span><span style="color: #000000;">,</span><span style="color: #000000;">30</span><span style="color: #000000;">)</span><span style="color: #000000;">: </span><span style="color: #000000;">(</span><span style="color: #000000;">Location of the symbol related to previous error</span><span style="color: #000000;">)</span><span style="color: #000000;">
Compilation failed: </span><span style="color: #000000;">2</span><span style="color: #000000;"> error</span><span style="color: #000000;">(</span><span style="color: #000000;">s</span><span style="color: #000000;">),</span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;"> warnings
btouch: API binding contains errors</span><span style="color: #000000;">.</span><span style="color: #000000;">
</span></pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<div>After looking at the errors and seeing the<strong><em> `CloudMade.BBox&#8217; does not contain a definition for `Messaging&#8217;</em></strong> message, it looked as if I was missing a using statement.&#160; However, this was not the case as <em>Messaging</em> is a class in the MonoTouch.ObjCRuntime namespace and that namespace was already included in the using statements.&#160; The problem actually turned out to be that the interface had the same name as the file and that had caused the issues shown above as the temporary classes generated during the process caused conflicts.&#160; The solution to this issue was as simple as renaming the file to something other than whatever the interfaces you are defining are named.</div>
<div>&#160;</div>
<div>So the moral of the story is:</div>
<p><strong><em>Do not give the file that the API definition is being saved in the same name as one of the interfaces that you are defining.</em></strong></p>
<p>Steer clear of that and you’ll be binding Objective-C types with ease.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kevfoo.com/index.php/2010/02/monotouch-binding-gotcha/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Chatsworth House Keeping and Update</title>
		<link>http://blog.kevfoo.com/index.php/2009/12/chatsworth-house-keeping-and-update/</link>
		<comments>http://blog.kevfoo.com/index.php/2009/12/chatsworth-house-keeping-and-update/#comments</comments>
		<pubDate>Sat, 12 Dec 2009 07:25:12 +0000</pubDate>
		<dc:creator>Kevin McMahon</dc:creator>
				<category><![CDATA[chatsworth]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Chatbot]]></category>
		<category><![CDATA[Chatroom]]></category>
		<category><![CDATA[Chatsworth House]]></category>
		<category><![CDATA[Configuration Experience]]></category>
		<category><![CDATA[Database Right]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[Feedback]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Holidays]]></category>
		<category><![CDATA[Home Server]]></category>
		<category><![CDATA[House Keeping]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[Logging Feature]]></category>
		<category><![CDATA[Personal Projects]]></category>
		<category><![CDATA[Requestor]]></category>
		<category><![CDATA[Suits]]></category>
		<category><![CDATA[Timestamp]]></category>
		<category><![CDATA[Two Areas]]></category>

		<guid isPermaLink="false">http://blog.kevfoo.com/index.php/2009/12/chatsworth-house-keeping-and-update/</guid>
		<description><![CDATA[I just moved Chatsworth from Google code over to its new home on github.&#160; I’ve got a couple more features in mind and figured now was as good a time as any to make the switch.&#160; I already host my iPhone samples and some personal projects on github and, given the smoother branching and merging [...]]]></description>
			<content:encoded><![CDATA[<p>I just moved <a href="http://blog.kevfoo.com/index.php/2009/01/chatsworth-a-google-talk-group-chat-bot/">Chatsworth</a> from <a href="http://code.google.com/p/chatsworth/">Google code</a> over to its new home on <a href="http://github.com/kevinmcmahon/chatsworth">github</a>.&#160; I’ve got a couple more features in mind and figured now was as good a time as any to make the switch.&#160; I already host my <a href="http://blog.kevfoo.com/index.php/2009/11/fun-with-monotouch-and-multi-level-table-views-without-interface-builder/">iPhone</a> <a href="http://blog.kevfoo.com/index.php/2009/11/monotouch-uialertview-uitextfield-crazy-delicious/">samples</a> and some personal projects on github and, given the smoother branching and merging experience of git, I think it will be more conducive to spiking some features and trying some ideas out.</p>
<p>As for the chatbot, I’ve recently added a link logging feature.&#160; Any URL sent to the chatroom now gets logged to the sqlite database.&#160; Users can query the database right from the chat window by entering <em><strong>/links &lt;number of previous links to return&gt;</strong></em> and the links, timestamp and the person who sent it will be sent in an individual IM to the requestor.</p>
<p>Going forward, the two areas that I think need the most improvement are installation and documentation.&#160; The majority of the questions and feedback that I have received are setup and configuration related.&#160; Improving the installation and documentation stories at this point make the most sense and would be worth the effort.&#160; </p>
<p>On the technical side of things, I am considering making a Chatsworth plugin for Windows Home Server.&#160; Currently I am running the service from my home server and, given the always on nature that suits the chatbot and the low/no maintenance needed to running once it is setup, the pairing seems natural and could help provide a little better setup and configuration experience.</p>
<p>I hope to work on this more over the holidays and please feel free to reach out with a question or feedback.&#160; Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kevfoo.com/index.php/2009/12/chatsworth-house-keeping-and-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
