<?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>MultiNC &#187; iPhone</title>
	<atom:link href="http://multinc.com/tag/iphone/feed/" rel="self" type="application/rss+xml" />
	<link>http://multinc.com</link>
	<description>Explorations in Social Computing</description>
	<lastBuildDate>Wed, 09 Dec 2009 19:05:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>iPhone SDK time bug for international users</title>
		<link>http://multinc.com/2009/09/27/iphone-sdk-time-bug-for-international-users/</link>
		<comments>http://multinc.com/2009/09/27/iphone-sdk-time-bug-for-international-users/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 07:00:39 +0000</pubDate>
		<dc:creator>huy</dc:creator>
				<category><![CDATA[Huy dev]]></category>
		<category><![CDATA[iPhone dev]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[france]]></category>
		<category><![CDATA[globalization]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[NSDateFormatter]]></category>

		<guid isPermaLink="false">http://multinc.com/?p=183</guid>
		<description><![CDATA[If your application is acting strange when your users are switching between 12-hour and 24-hour mode in their iPhone settings, you may be experiencing the same thing we are: an NSDateFormatter bug in the iPhone SDK 3.1 (or earlier).
MultiNC develops iPhone applications for a number of global markets, and sometimes we run into bugs unique [...]]]></description>
			<content:encoded><![CDATA[<p>If your application is acting strange when your users are switching between 12-hour and 24-hour mode in their iPhone settings, you may be experiencing the same thing we are: an NSDateFormatter bug in the iPhone SDK 3.1 (or earlier).</p>
<p>MultiNC develops iPhone applications for a number of global markets, and sometimes we run into bugs unique to globalized applications.  One application that we&#8217;re developing has France as primary market.  U.S. users very rarely change their settings from the usual 12-hour mode (AM/PM mode) to 24-hour mode.  However, in France it&#8217;s not rare for users to switch from the more common 24-hour mode to 12-hour mode.  And that&#8217;s when things start acting strange, even causing your application to crash.</p>
<p>Because of users&#8217; regional habits, developers of globalized applications are more likely to encounter this time bug than for US applications.</p>
<h2>Region format &amp; 24-hour mode setting</h2>
<p>First, a little background on the iPhone user interface.  When iPhone users change their region format between, say, &#8220;United States&#8221; and &#8220;France&#8221;, the users&#8217; &#8220;24-Hour Time&#8221; setting is automatically switched to the mode that is most prevalent in that region.  In France, that would set 24-Hour Time to &#8220;ON&#8221;, and in the U.S., that would set it to &#8220;OFF&#8221;.  The users can then manually override that setting and that&#8217;s where trouble starts.</p>
<h2>NSDateFormatter bug</h2>
<p>The pattern of this SDK bug was relatively tricky to determine because of the specific combination and sequence of user settings that would trigger it, but now it&#8217;s actually quite simple to explain.</p>
<p>The problem comes from NSDateFormatter somehow &#8220;getting stuck&#8221; in the 12 or 24-hour time mode that the user has manually selected.  So if a French user manually selects 12-hour mode,  and the application requested NSDateFormatter to output time with the 24-hour format &#8220;HHmm&#8221;, it would actually receive time in a 12-hour format, e.g. &#8220;01:00 PM&#8221;, as if the application had instead requested &#8220;hhmm aa&#8221;.  The reverse would happen if a US user manually selected 24-hour mode: outputting time with the 12-hour  format &#8220;hhmm aa&#8221; would actually get you time in the 24-hour format instead, e.g. &#8220;17:00&#8243;.</p>
<p>This bug turns especially nasty when your application is trying to parse time from a string, rather than outputing.  Similar to the above, the NSDateFormatter seems to be stuck in the time mode that the user has manually chosen and insists on reading time that way, regardless of the string format.  What you can end up with is an incomplete or invalid NSDate, which when later used can cause other parts of the application to crash, as the UIDatePicker did for us.</p>
<p>We are developing with the iPhone SDK version 3.1 beta, but we wouldn&#8217;t be surprised if it applied to all previous SDKs.</p>
<h2>Workaround</h2>
<p>Now that you know the source of the bug, a workaround is straightforward.  But to save you time until Apple fixes it, with our client <a href="http://www.fabernovel.com/">faberNovel</a>&#8217;s gracious permission, here&#8217;s our workaround when dealing in 24-hour time (dealing in 12-hour time would be very similar):</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">// Returns time string in 24-hour mode from the given NSDate</span>
<span style="color: #002200;">+</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>time24FromDate<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSDate</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>date withTimeZone<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSTimeZone</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>timeZone
<span style="color: #002200;">&#123;</span>
	<span style="color: #400080;">NSDateFormatter</span> <span style="color: #002200;">*</span>dateFormatter<span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSDateFormatter</span> alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>dateFormatter setDateFormat<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;HH:mm&quot;</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>dateFormatter setTimeZone<span style="color: #002200;">:</span>timeZone<span style="color: #002200;">&#93;</span>;
	<span style="color: #400080;">NSString</span><span style="color: #002200;">*</span> <span style="color: #a61390;">time</span> <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>dateFormatter stringFromDate<span style="color: #002200;">:</span>date<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>dateFormatter release<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">time</span>.length &gt; <span style="color: #2400d9;">5</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
		<span style="color: #a61390;">NSRange</span> range;
		range.location <span style="color: #002200;">=</span> <span style="color: #2400d9;">3</span>;
		range.length <span style="color: #002200;">=</span> <span style="color: #2400d9;">2</span>;
		<span style="color: #a61390;">int</span> hour <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #a61390;">time</span> substringToIndex<span style="color: #002200;">:</span><span style="color: #2400d9;">2</span><span style="color: #002200;">&#93;</span> intValue<span style="color: #002200;">&#93;</span>;
		<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>minute <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #a61390;">time</span> substringWithRange<span style="color: #002200;">:</span>range<span style="color: #002200;">&#93;</span>;
		range <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #a61390;">time</span> rangeOfString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;AM&quot;</span><span style="color: #002200;">&#93;</span>;
		<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>range.length<span style="color: #002200;">==</span><span style="color: #2400d9;">0</span><span style="color: #002200;">&#41;</span>
			hour <span style="color: #002200;">+=</span> <span style="color: #2400d9;">12</span>;
		<span style="color: #a61390;">time</span> <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSString</span> stringWithFormat<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;%02d:%@&quot;</span>, hour, minute<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#125;</span>
&nbsp;
	<span style="color: #a61390;">return</span> <span style="color: #a61390;">time</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #11740a; font-style: italic;">// Returns a proper NSDate given a time string in 24-hour mode</span>
<span style="color: #002200;">+</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSDate</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>dateFromTime24<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>time24String withTimeZone<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSTimeZone</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>timeZone
<span style="color: #002200;">&#123;</span>
	<span style="color: #a61390;">int</span> hour <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>time24String substringToIndex<span style="color: #002200;">:</span><span style="color: #2400d9;">2</span><span style="color: #002200;">&#93;</span> intValue<span style="color: #002200;">&#93;</span>;
	<span style="color: #a61390;">int</span> minute <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>time24String substringFromIndex<span style="color: #002200;">:</span><span style="color: #2400d9;">3</span><span style="color: #002200;">&#93;</span> intValue<span style="color: #002200;">&#93;</span>;
	<span style="color: #400080;">NSDateFormatter</span> <span style="color: #002200;">*</span>dateFormatter<span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSDateFormatter</span> alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>dateFormatter setTimeZone<span style="color: #002200;">:</span>timeZone<span style="color: #002200;">&#93;</span>;	
&nbsp;
	<span style="color: #400080;">NSDate</span> <span style="color: #002200;">*</span>result;
	<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span>Util userSetTwelveHourMode<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
		<span style="color: #002200;">&#91;</span>dateFormatter setDateFormat<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;hh:mm aa&quot;</span><span style="color: #002200;">&#93;</span>;
		<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>hour &gt; <span style="color: #2400d9;">12</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
			result <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>dateFormatter dateFromString<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSString</span> stringWithFormat<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;%02d:%02d PM&quot;</span>, hour <span style="color: #002200;">-</span> <span style="color: #2400d9;">12</span>, minute<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
		<span style="color: #002200;">&#125;</span> <span style="color: #a61390;">else</span> <span style="color: #002200;">&#123;</span>
			result <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>dateFormatter dateFromString<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSString</span> stringWithFormat<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;%02d:%02d AM&quot;</span>, hour, minute<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
		<span style="color: #002200;">&#125;</span>
	<span style="color: #002200;">&#125;</span> <span style="color: #a61390;">else</span> <span style="color: #002200;">&#123;</span>
		<span style="color: #002200;">&#91;</span>dateFormatter setDateFormat<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;HH:mm&quot;</span><span style="color: #002200;">&#93;</span>;
		result <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>dateFormatter dateFromString<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSString</span> stringWithFormat<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;%02d:%02d&quot;</span>, hour, minute<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#125;</span>
	<span style="color: #002200;">&#91;</span>dateFormatter release<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #a61390;">return</span> result;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #11740a; font-style: italic;">// Tests whether the user has set the 12-hour or 24-hour mode in their settings.</span>
<span style="color: #002200;">+</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">BOOL</span><span style="color: #002200;">&#41;</span>userSetTwelveHourMode
<span style="color: #002200;">&#123;</span>
	<span style="color: #400080;">NSDateFormatter</span> <span style="color: #002200;">*</span>testFormatter <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSDateFormatter</span> alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>testFormatter setTimeStyle<span style="color: #002200;">:</span>NSDateFormatterShortStyle<span style="color: #002200;">&#93;</span>;
	<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>testTime <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>testFormatter stringFromDate<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSDate</span> date<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>testFormatter release<span style="color: #002200;">&#93;</span>;
	<span style="color: #a61390;">return</span> <span style="color: #002200;">&#91;</span>testTime hasSuffix<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;M&quot;</span><span style="color: #002200;">&#93;</span> || <span style="color: #002200;">&#91;</span>testTime hasSuffix<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;m&quot;</span><span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #11740a; font-style: italic;">// Converts a 24-hour time string to 12-hour time string</span>
<span style="color: #002200;">+</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>time12FromTime24<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>time24String
<span style="color: #002200;">&#123;</span>
	<span style="color: #400080;">NSDateFormatter</span> <span style="color: #002200;">*</span>testFormatter <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSDateFormatter</span> alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;
	<span style="color: #a61390;">int</span> hour <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>time24String substringToIndex<span style="color: #002200;">:</span><span style="color: #2400d9;">2</span><span style="color: #002200;">&#93;</span> intValue<span style="color: #002200;">&#93;</span>;
	<span style="color: #a61390;">int</span> minute <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>time24String substringFromIndex<span style="color: #002200;">:</span><span style="color: #2400d9;">3</span><span style="color: #002200;">&#93;</span> intValue<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>result <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSString</span> stringWithFormat<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;%02d:%02d %@&quot;</span>, hour <span style="color: #002200;">%</span> <span style="color: #2400d9;">12</span>, minute, hour &gt; <span style="color: #2400d9;">12</span> ? <span style="color: #002200;">&#91;</span>testFormatter PMSymbol<span style="color: #002200;">&#93;</span> <span style="color: #002200;">:</span> <span style="color: #002200;">&#91;</span>testFormatter AMSymbol<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>testFormatter release<span style="color: #002200;">&#93;</span>;
	<span style="color: #a61390;">return</span> result;
<span style="color: #002200;">&#125;</span></pre></div></div>

<h3>References:</h3>
<ul>
<li>StackOverflow &#8211; <a href="http://stackoverflow.com/questions/143075/nsdateformatter-am-i-doing-something-wrong-or-is-this-a-bug">NSDateFormatter, am I doing something wrong or is this a bug?</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://multinc.com/2009/09/27/iphone-sdk-time-bug-for-international-users/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Compatibility between the iPhone App Store and the LGPL</title>
		<link>http://multinc.com/2009/08/24/compatibility-between-the-iphone-app-store-and-the-lgpl/</link>
		<comments>http://multinc.com/2009/08/24/compatibility-between-the-iphone-app-store-and-the-lgpl/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 03:54:31 +0000</pubDate>
		<dc:creator>huy</dc:creator>
				<category><![CDATA[Huy dev]]></category>
		<category><![CDATA[iPhone dev]]></category>
		<category><![CDATA[App Store]]></category>
		<category><![CDATA[Cydia]]></category>
		<category><![CDATA[GPL]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPod Touch]]></category>
		<category><![CDATA[LGPL]]></category>
		<category><![CDATA[licensing]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://multinc.com/?p=157</guid>
		<description><![CDATA[LGPL Conditions
If you&#8217;re developing an iPhone application that you intend to submit to Apple&#8217;s App Store and you want to make use of a third-party&#8217;s software library that happens to be licensed under the GNU Lesser General Public License (LGPL), you have a couple of choices according to the license requirements:

You can open-source your app.  [...]]]></description>
			<content:encoded><![CDATA[<h2>LGPL Conditions</h2>
<p>If you&#8217;re developing an iPhone application that you intend to submit to Apple&#8217;s App Store and you want to make use of a third-party&#8217;s software library that happens to be licensed under the <a href="http://www.gnu.org/licenses/lgpl.html">GNU Lesser General Public License (LGPL)</a>, you have a couple of choices according to the license requirements:</p>
<ul>
<li>You can open-source your app.  Specifically, you provide to your users the source code of your entire application under the LGPL or GPL.  That means for example all the .h and .m files.</li>
<li><em>You can keep your app closed-source, but you provide to your users all the object code</em> of your  application necessary to re-link your application.  That means for example all the .o and .a files.  Most people forget that this option is in fact available to iPhone app developers.</li>
</ul>
<p>Of course, if you modify the library itself, you have to provide these code changes in source form either way.</p>
<h2>Dynamic/Shared Library</h2>
<p>The above LGPL conditions can be thought to apply to the case when the LGPL library is statically linked.</p>
<p>But outside of the world of Apple&#8217;s App Store, the LGPL would normally give you another way to use LGPL code without releasing the source code or object code for your application: compiling your application with a run-time shared library (hence, allowing users to run your application with an updated library if they choose to).  The problem for us is that the Apple iPhone developer agreement doesn&#8217;t allow the bundling of shared libraries.</p>
<p>If you don&#8217;t care about the App Store and want to release/sell your application <a href="http://iphone.stackswap.net/scummvm-adhoc.html">through Ad Hoc Distribution</a> or to jailbroken devices (e.g. via <a href="http://cydia.saurik.com/">Cydia</a>), you can actually link apps with a run-time shared library and thus satisfy the LGPL without providing source code or object code.</p>
<h2>Static Library Exception</h2>
<p>Some library developers are aware of these iPhone and LGPL incompatibilities and provide a &#8220;static library exception,&#8221; loosening LGPL requirements for the iPhone platform.  For example, the cocos2d author intended to <a href="http://cocos2d-iphone.googlecode.com/svn/trunk/LICENSE">offer such an exception</a>: even though he neglected to distinguish between the source code and object code requirements of the LGPL, it&#8217;s fairly clear he intended to relieve the app developer from having to provide source <em>or</em> object code even if they linked in the LGPL library <em>statically</em>.</p>
<p>It&#8217;s a good idea for you to consider contacting the author of the LGPL library you&#8217;re interested in to offer a similar exception for the iPhone.  That way you don&#8217;t have to worry about having to provide object code for your app.</p>
<h2>Spirit of the LGPL</h2>
<p>Whether you decide to release the object code for your app or take advantage of a &#8220;static library exception,&#8221; the spirit of the LGPL is violated by the iPhone restrictions: it becomes very difficult for your app user to customize your app with a modified or updated version of LGPL library.</p>
<p>Let&#8217;s say you do release all the object code and all the utilities that your app requires to build a new app based on an improved LGPL library.  How can your users install the new binary?  They are faced with the following unhappy options:</p>
<ul>
<li>Jailbreak their iPhone to install any binary that they want</li>
<li>Join the iPhone Developer Program for $99 a year to be able to legally distribute &#8220;Ad Hoc&#8221; the new app to up to 100 devices.</li>
</ul>
<p>In other words, you may end up spending a lot of time distributing object code to satisfy the LGPL and protect the source code of your app, but the object code is very unlikely to get used anyway.</p>
<p>In fact, even if Apple allowed apps to link with dynamic shared libraries, how could users even substitute the libraries without jailbreaking their iPhone?</p>
<p>No wonder the Free Software Foundation <a href="http://www.fsf.org/blogs/community/5-reasons-to-avoid-iphone-3g">hates the iPhone</a>.</p>
<h4>References:</h4>
<ul>
<li><a href="http://www.gnu.org/licenses/lgpl.html">GNU Lesser General Public License</a>, particularly section 4.d)</li>
<li><a href="http://stackoverflow.com/questions/459833/which-open-source-licenses-are-compatible-with-the-iphone-and-app-store/1321681#1321681">StackOverflow &#8211; Which open source licenses are compatible with the iPhone and App Store?</a></li>
<li><a href="http://www.nabble.com/iphone,-and-releasing-object-code-satisfies-LGPL-Re:-Static-building-and-bundling-of-SDL.-td21907721.html">Nabble &#8211; iphone, and releasing object code satisfies LGPL Re: Static building and bundling of SDL.</a></li>
<li><a href="http://www.nabble.com/iPhone-SDK-%3C-%3E-SDL-License-td19983219.html">Nabble &#8211; iPhone SDK &lt;-&gt; SDL License</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://multinc.com/2009/08/24/compatibility-between-the-iphone-app-store-and-the-lgpl/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>DiskAid &#8211; tool to transfer files to/from iPhone or iPod Touch</title>
		<link>http://multinc.com/2009/05/18/diskaid-tool-to-transfer-files-tofrom-iphone-or-ipod-touch/</link>
		<comments>http://multinc.com/2009/05/18/diskaid-tool-to-transfer-files-tofrom-iphone-or-ipod-touch/#comments</comments>
		<pubDate>Tue, 19 May 2009 03:31:32 +0000</pubDate>
		<dc:creator>huy</dc:creator>
				<category><![CDATA[Huy dev]]></category>
		<category><![CDATA[iPhone dev]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPod Touch]]></category>

		<guid isPermaLink="false">http://multinc.com/?p=151</guid>
		<description><![CDATA[You can use the free DiskAid tool to transfer files between your computer and your iPhone or iPod Touch]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a useful and free tool for seeing the filesystem of your iPhone and iPod Touch once it&#8217;s connected to your PC or Mac via USB cable and transferring files: <a href="http://www.digidna.net/diskaid/">DiskAid</a></p>
<p>Before this will work, you may have to ensure the following:</p>
<p>In Windows, the &#8220;Apple Mobile Device&#8221; service must be running<br />
You should enter the Passcode on your iPhone or iPod Touch<br />
The device must be jailbroken if you want to see anything outside the Media folder, e.g. if you want to see the root folder.</p>
]]></content:encoded>
			<wfw:commentRss>http://multinc.com/2009/05/18/diskaid-tool-to-transfer-files-tofrom-iphone-or-ipod-touch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Developing iPhone Applications using Java may not be such a good idea</title>
		<link>http://multinc.com/2009/03/19/developing-iphone-applications-using-java-is-maybe-not-a-good-idea/</link>
		<comments>http://multinc.com/2009/03/19/developing-iphone-applications-using-java-is-maybe-not-a-good-idea/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 10:50:15 +0000</pubDate>
		<dc:creator>huy</dc:creator>
				<category><![CDATA[Huy dev]]></category>
		<category><![CDATA[iPhone dev]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Rhodes]]></category>
		<category><![CDATA[XMLVM]]></category>

		<guid isPermaLink="false">http://multinc.com/wp/?p=131</guid>
		<description><![CDATA[Developing iPhone Applications without using Objective C
When the iPhone SDK came out in March 2008, mobile developers were very excited to be able to develop native applications for the increasingly popular device.  However, that excitement was partially tempered by some requirements of the platform, which for most meant learning how to program Objective C, a [...]]]></description>
			<content:encoded><![CDATA[<h2>Developing iPhone Applications without using Objective C</h2>
<p>When the iPhone SDK came out in March 2008, mobile developers were very excited to be able to develop native applications for the increasingly popular device.  However, that excitement was partially tempered by some requirements of the platform, which for most meant learning how to program Objective C, a language that only Mac developers are familiar with.  Just as with iPod users, iPhone application developers do come from all walks of life&#8211;they&#8217;re not all Mac die-hards.</p>
<p>As as result there have been several efforts to produce a framework or tool with which applications could be developed using more familiar languages. <a href="http://rhomobile.com/products/rhodes">Rhodes</a> does this for Ruby programmers. <a href="http://www.xmlvm.org/">XMLVM</a> does this for Java programmers.</p>
<h2>XMLVM</h2>
<p>I watched the <a href="http://www.youtube.com/watch?v=s8nMpi5-P-I">Google Tech Talk</a> about XMLVM, which goes into significant depth about the conversion process.  Essentially, the technology does cross-compilation from the compiled version of your Java application, in other words JVM bytecode instead of Java source code. Thus, the entire process of compiling an iPhone application would consist of Java source -&gt; JVM bytecode -&gt; Objective C source -&gt; native iPhone binary.  The speaker goes into detail with an example showing the conversion of JVM bytecode into Objective C source, which is easy to understand and can be educational.</p>
<p>Opting for bytecode as source for XMLVM makes it easier to implement but produces bloated code.  Not only that, but the bytecode is converted not into native iPhone native code, but into Objective C source code.  Add to that that the conversion is done using XSLT, and you can guess how inefficient the process and the output will be.</p>
<p>The speaker emphasizes that this is an academic project without abundant resources, with the implication that the code produced by this reference implementation is not expected to perform well for commercial purposes.  So while it&#8217;s interesting to see this idea in action, not even the speaker believes that this cross-compiler can be put to serious use yet, if ever.</p>
<h3>Other languages for the XMLVM</h3>
<p>Java is not the only source language that can benefit from XMLVM.  There is support for other input languages and output code.  See the <a href="http://www.xmlvm.org">website</a> for more information.</p>
<h3>Enhancing the iPhone emulator with hardware data</h3>
<p>One nice tool that the XMLVM team developed was a way to send device data to the desktop emulator, which naturally cannot emulate everything that the iPhone can do.  For example, you can use a real iPod Touch or iPhone to send accelerometer to the emulator.  The same could be envisioned for other functionality, e.g. GPS, light sensor, proximity sensor, etc.  I imagine this is so helpful for the development process that others must have implemented something like that as well.</p>
<h2>Better to Develop in Objective C</h2>
<p>My opinion regarding these kinds of language-adapting frameworks or tools that allow developers to code in their familiar language is not very positive.  In general, I don&#8217;t think it&#8217;s a good idea to distance yourself from the target platform.  Problems include:</p>
<ul>
<li>Limited functionality</li>
<li>Lower performance</li>
<li>More complicated development process</li>
<li>More source of bugs in your way (from not just the iPhone OS and SDK, but from the language adapter)</li>
<li>Smaller community of developers, fewer development tools, less documentation</li>
</ul>
<p>All these problems are multiplied when you&#8217;re dealing with a hot platform like the iPhone, where innovation comes fast along with bugs and the language adapter is always one or more steps behind on completeness, robustness, and performance optimization.  Do you really want to develop cool apps with only features that are &#8220;so last year&#8221;?  The fact that the iPhone platform and its evolution are so closed doesn&#8217;t help either.</p>
]]></content:encoded>
			<wfw:commentRss>http://multinc.com/2009/03/19/developing-iphone-applications-using-java-is-maybe-not-a-good-idea/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
