<?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>Chuck Freedman &#187; iPhone</title>
	<atom:link href="http://www.chuckstar.com/blog/category/technology/iphone/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chuckstar.com/blog</link>
	<description>excerpts from the mind of a platform evangelist</description>
	<lastBuildDate>Sun, 29 Jan 2012 09:05:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>AIR/Flex for iOS &amp; Android app deployment notes</title>
		<link>http://www.chuckstar.com/blog/technology/airflex-for-ios-android-app-deployment-notes/</link>
		<comments>http://www.chuckstar.com/blog/technology/airflex-for-ios-android-app-deployment-notes/#comments</comments>
		<pubDate>Fri, 03 Jun 2011 14:23:08 +0000</pubDate>
		<dc:creator>chuckstar</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.chuckstar.com/blog/?p=1224</guid>
		<description><![CDATA[It&#8217;s been 2 years since I wrote a native iPhone app and successfully launched it to the App store. I have been working with native Android off and on since July of 2010. Learning (really playing) with these respective platform technologies has been challenging and fun. In researching some new platform strategies for litl, I [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.chuckstar.com%2Fblog%2Ftechnology%2Fairflex-for-ios-android-app-deployment-notes%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.chuckstar.com%2Fblog%2Ftechnology%2Fairflex-for-ios-android-app-deployment-notes%2F&amp;source=chuckstar&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>It&#8217;s been 2 years since I wrote a native iPhone app and <a href="http://itunes.apple.com/us/app/rock-the-rim/id325892192?mt=8">successfully launched it to the App store</a>. I have been working with native Android off and on since July of 2010. Learning (really playing) with these respective platform technologies has been challenging and fun. In researching some new platform strategies for litl, I needed to start checking out some &#8216;write once&#8217; technologies. I started looking at <a href="http://www.anscamobile.com/corona/">Corona</a> and <a href="http://www.adobe.com/devnet/air.html">AIR</a> especially. Ultimately, my familiarity and access to AIR led me to dive into reusing my Flash chops.. for now. The results, so far, have been staggeringly easy and exciting.</p>
<p><iframe src="http://player.vimeo.com/video/24479232?portrait=0" width="500" height="300" frameborder="0"></iframe></p>
<p>This demo app is pretty simple, using Touch events, some Flex Spark effects for animation and sound playback. The example is less than 100 lines of code. The devices you see are the iPad2 and the yet-to-be-released <a href="http://news.cnet.com/8301-17938_105-20066964-1/samsung-galaxy-tab-10.1-google-i-o-edition-review-thin-light-and-spinnable/">Samsung 10.1 Tab distributed at GoogleIO</a>.</p>
<p>Overall, the performance on both devices is impressive. I&#8217;ve noticed a few more bugs on the Android side, mostly resulting in quirky touch handling and disappearing sprites. Also, the sound takes a little longer to load on the Android tablet. Aside from these issues, it&#8217;s been great showing these results to colleagues. I&#8217;m hoping to build out the demo app into an actual game. Also, I&#8217;d love to get my hands on some other devices (the Playbook and Nook Color) to test this process out more.</p>
<p>Here is an account of the steps I took to complete this experiment, along with approx times. Note the quickness getting this on my Android tablet vs the lengthy process of setting up my MBP to deploy to the iPad2:</p>
<table width=500>
<tr>
<th width=25></th>
<th width=375>Step</th>
<th width=100>Time (mins)</th>
</tr>
<tr>
<td>1.</td>
<td>
Downloaded latest FlashBuilder 4.5 with AIR 2.7
</td>
<td>~45</td>
</tr>
<tr>
<td>2.</td>
<td>
Coded initial demo<br />
- Setup Flex Mobile project<br />
- Coding app, mostly remembering how to do simple things in AS3 and Flex<br />
- Launched AIR simulator/emulator to test app
</td>
<td>~60</td>
</tr>
<tr>
<td>3.</td>
<td>
Setup Macbook Pro for app deployment to iPad<br />
- Update xCode version<br />
- Update Mac OS version<br />
- Create certificate<br />
- Provision device
</td>
<td>~120</td>
</tr>
<tr>
<td>4.</td>
<td>
Actually deploy app to iPad2 via Organizer in Xcode
</td>
<td>~5</td>
</tr>
<tr>
<td>5.</td>
<td>
Setup Macbook for app deployment to Android
</td>
<td>0</td>
</tr>
<tr>
<td>6.</td>
<td>
Actually deploy app to Samsung 10.1 Tab via FlashBuilder
</td>
<td>~1</td>
</tr>
</table>
<hr />
You&#8217;ll find the following links essential to figuring this all out:</p>
<p>Packaging apps for Android (from FlashBuilder):<br />
<a href="http://www.adobe.com/devnet/air/articles/packaging-air-apps-android.html">http://www.adobe.com/devnet/air/articles/packaging-air-apps-android.html</a></p>
<p>Packaging apps for iOS (from FlashBuilder):<br />
<a href="http://www.adobe.com/devnet/air/articles/packaging-air-apps-ios.html">http://www.adobe.com/devnet/air/articles/packaging-air-apps-ios.html</a></p>
<p>The provisioning and certificate steps from Apple&#8217;s iOS dev center:<br />
<a href="http://developer.apple.com/devcenter/ios/">http://developer.apple.com/devcenter/ios/</a> [account required]</p>
<p>AS3 Touch Event handling:<br />
<a href="http://help.adobe.com/en_US/as3/dev/WS1ca064e08d7aa93023c59dfc1257b16a3d6-7ffe.html">http://help.adobe.com/en_US/as3/dev/WS1ca064e08d7aa93023c59dfc1257b16a3d6-7ffe.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.chuckstar.com/blog/technology/airflex-for-ios-android-app-deployment-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Is it Apple or game developers that deserve the credit?</title>
		<link>http://www.chuckstar.com/blog/technology/is-it-apple-or-game-developers-that-deserve-the-credit/</link>
		<comments>http://www.chuckstar.com/blog/technology/is-it-apple-or-game-developers-that-deserve-the-credit/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 20:39:04 +0000</pubDate>
		<dc:creator>chuckstar</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.chuckstar.com/blog/?p=776</guid>
		<description><![CDATA[A lot of numbers, reports and success stories have been coming out about Apple&#8217;s growth and recent dominance in the mobile game space. They&#8217;ve been stealing some serious market share from mobile game powerhouses Nintendo and Sony. Since Apple owns the products and processes for playing and distributing the games, I understand why the big [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.chuckstar.com%2Fblog%2Ftechnology%2Fis-it-apple-or-game-developers-that-deserve-the-credit%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.chuckstar.com%2Fblog%2Ftechnology%2Fis-it-apple-or-game-developers-that-deserve-the-credit%2F&amp;source=chuckstar&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://tweakosx.com/" target="_blank"><img src="http://tweakosx.com/wp-content/uploads/2008/10/apple-stock.jpg" alt="Apple Stock" border="0" /></a></p>
<p>A lot of numbers, reports and success stories have been coming out about Apple&#8217;s growth and recent dominance in the mobile game space. They&#8217;ve been stealing some serious market share from mobile game powerhouses Nintendo and Sony. Since Apple owns the products and processes for playing and distributing the games, I understand why the big success has been largely pronounced for them. I also give them credit for introducing and &#8216;opening up&#8217; new control APIs to developers to build games with, namely accelerometer and touch. While these features were available in other game systems, Apple opened them up to developers and provided a relatively unobstructed way to distribute the apps, and better yet, generate direct revenue from the sale of them.</p>
<p><a href="http://techcrunch.com/2010/03/22/flurry-iphone-games-500-million/" target="_blank"><em>iPhone games now a $500 million industry.</em></a></p>
<p><a href="http://www.techspot.com/news/38329-sony-and-nintendo-suffer-at-the-hands-of-apples-ipod-touch-iphone.html" target="_blank"><em>Sony and Nintendo losing market share to Apple&#8217;s iPhone and iPod</em></a></p>
<p>All this being said, I still think there&#8217;s an absurd lack of credit being given to game developers. One would think that clearly, after decades of video game progress and industry growth, there would be a vacuum of thousands of developers with great gaming ideas and general ability ready/willing/wanting to create their own games. Restricted to the closed distribution model that long-standing game system manufacturers still foster, there was no way for all of these independent game developers &#8216;in waiting&#8217; to get their idea built and deployed to the masses.</p>
<p><em><a href="http://www.informationweek.com/news/personal_tech/iphone/showArticle.jhtml?articleID=217801029" target="_blank">Apple iPhone developers mostly don&#8217;t make much money</a></em></p>
<p><em><a href="http://www.bit-101.com/blog/?p=2294" target="_blank">iPhone Dev: The Honeymoon is Over</a></em></p>
<p>I&#8217;m not saying Apple should do something extra special to recognize developers here&#8230; there are already some games generating millions for their makers. I think the industry needs to recognize how powerful the developer&#8217;s role is in the free-market app and game economy. Apple might be the big winner now, but they won&#8217;t be the only player for long. <strong>Other platforms, mobile and otherwise, would do well and should always put the developer&#8217;s success before their own.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.chuckstar.com/blog/technology/is-it-apple-or-game-developers-that-deserve-the-credit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone game Rock The Rim video posted</title>
		<link>http://www.chuckstar.com/blog/technology/iphone-game-rock-the-rim-video-posted/</link>
		<comments>http://www.chuckstar.com/blog/technology/iphone-game-rock-the-rim-video-posted/#comments</comments>
		<pubDate>Sat, 22 Aug 2009 16:36:07 +0000</pubDate>
		<dc:creator>chuckstar</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.chuckstar.com/blog/?p=425</guid>
		<description><![CDATA[I&#8217;ve posted a little teaser and instructional video for my first iPhone game, &#8220;Rock The Rim&#8221;. Based on user feedback and watching friends play, I realize the game may be a little more Wii-like than most iPhone/iPod owners are used to. Once folks catch on how to play, it becomes as fun and addictive as [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.chuckstar.com%2Fblog%2Ftechnology%2Fiphone-game-rock-the-rim-video-posted%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.chuckstar.com%2Fblog%2Ftechnology%2Fiphone-game-rock-the-rim-video-posted%2F&amp;source=chuckstar&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I&#8217;ve posted a little teaser and instructional video for my first iPhone game, &#8220;Rock The Rim&#8221;. Based on user feedback and watching friends play, I realize the game may be a little more Wii-like than most iPhone/iPod owners are used to. Once folks catch on how to play, it becomes as fun and addictive as I intended.</p>
<p><object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/GOVBAx7lUUs&#038;hl=en&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/GOVBAx7lUUs&#038;hl=en&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object></p>
<p>The game can be downloaded/installed from iTunes <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=325892192&#038;mt=8">here</a>:<br />
<a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=325892192&#038;mt=8">http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=325892192&#038;mt=8</a></p>
<p>Be sure to leave positive feedback if you like the game!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chuckstar.com/blog/technology/iphone-game-rock-the-rim-video-posted/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone Sample: Calling methods in between classes</title>
		<link>http://www.chuckstar.com/blog/technology/iphone-sample-calling-methods-in-between-classes/</link>
		<comments>http://www.chuckstar.com/blog/technology/iphone-sample-calling-methods-in-between-classes/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 13:48:46 +0000</pubDate>
		<dc:creator>chuckstar</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.chuckstar.com/blog/?p=384</guid>
		<description><![CDATA[At some point along my iPhone learning curve, I had to recall some basic principles of object oriented programming &#8212; like calling a method from one class to another to pass data. For some reason, using MVC, I was trying to store data objects centrally, assuming all classes would have access to that data. This [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.chuckstar.com%2Fblog%2Ftechnology%2Fiphone-sample-calling-methods-in-between-classes%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.chuckstar.com%2Fblog%2Ftechnology%2Fiphone-sample-calling-methods-in-between-classes%2F&amp;source=chuckstar&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>At some point along my iPhone learning curve, I had to recall some basic principles of object oriented programming &#8212; like calling a method from one class to another to pass data. For some reason, using MVC, I was trying to store data objects centrally, assuming all classes would have access to that data. This proved harder than one would imagine. When I finally figured out how to access and call methods in between classes, passing data got much easier.</p>
<p>The code below shows how to:<br />
- Create an instance of another class within a class<br />
- Call a method of another class<br />
- Pass a variable to a method of another class</p>
<p>First, you need to include the header of the &#8216;other&#8217; class whose method you want to call:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#import &quot;ThisViewClass.h&quot;</span>
<span style="color: #339933;">#import &quot;OtherViewClass.h&quot;</span>
&nbsp;
@implementation ThisViewClass
.</pre></div></div>

<p>Second, you need to create an instance of that &#8216;other&#8217; class and call the method, passing the parameter (variable) when needed. This assumes the method you are calling in the other class is inside the view. Otherwise, drop the &#8216;.view&#8217;:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span> insideSomeMethod <span style="color: #009900;">&#123;</span>
     <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#40;</span>OtherViewClass <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>self.<span style="color: #202020;">view</span> setName<span style="color: #339933;">:</span>@<span style="color: #ff0000;">&quot;chuckstar&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>In the &#8216;other&#8217; class, here&#8217;s how the method you&#8217;re calling appears:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span> setName<span style="color: #339933;">:</span><span style="color: #009900;">&#40;</span>NSString <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>name <span style="color: #009900;">&#123;</span>
	coolPerson.<span style="color: #202020;">text</span> <span style="color: #339933;">=</span> name<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Lastly, you&#8217;ll need to expose that method in the class header:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">.
@interface OtherViewClass <span style="color: #339933;">:</span> UIViewController <span style="color: #009900;">&#123;</span>
      .
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span> setName<span style="color: #339933;">:</span><span style="color: #009900;">&#40;</span>NSString <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>name<span style="color: #339933;">;</span>
@end</pre></div></div>

<p>Of course, there are other ways to reference the &#8216;other&#8217; class instance, like adding it as a view using initWithNibName. I&#8217;ll take a look at that in a future post. </p>
<p>If you&#8217;ve got a better, more efficient way of doing the above, please feel free to comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chuckstar.com/blog/technology/iphone-sample-calling-methods-in-between-classes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Adobe Fireworks thrives in my iPhone development workflow</title>
		<link>http://www.chuckstar.com/blog/technology/adobe-fireworks-thrives-inside-my-iphone-development-workflow/</link>
		<comments>http://www.chuckstar.com/blog/technology/adobe-fireworks-thrives-inside-my-iphone-development-workflow/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 20:57:47 +0000</pubDate>
		<dc:creator>chuckstar</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.chuckstar.com/blog/?p=377</guid>
		<description><![CDATA[I don&#8217;t know where the Fireworks team at Adobe ranks. Given the obvious rabid developer fanfare over Flash, Flex and AIR, the longtime reign of Photoshop and Premiere, and ever hot ColdFusion and LiveCycle, you got to wonder where Fireworks lives in Adobe&#8217;s heart. I mean, if they were to do an award show, how [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.chuckstar.com%2Fblog%2Ftechnology%2Fadobe-fireworks-thrives-inside-my-iphone-development-workflow%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.chuckstar.com%2Fblog%2Ftechnology%2Fadobe-fireworks-thrives-inside-my-iphone-development-workflow%2F&amp;source=chuckstar&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://www.flickr.com/photos/bestrated1/183462290/"><img src="http://farm1.static.flickr.com/53/183462290_5e794e9ab7_m.jpg" alt="Fireworks" /></a></p>
<p>I don&#8217;t know where the Fireworks team at Adobe ranks. Given the obvious rabid developer fanfare over Flash, Flex and AIR, the longtime reign of Photoshop and Premiere, and ever hot ColdFusion and LiveCycle, you got to wonder where Fireworks lives in Adobe&#8217;s heart. I mean, if they were to do an award show, how long would it take the Fireworks team to walk from the back of the auditorium to accept an award?</p>
<p>I&#8217;ve always loved Fireworks. I use it for everything. I use it to design web pages. I use it to design Flash and Flex assets. I even use it to remove red-eye from family photos. At a certain Flash platform evangelist&#8217;s birthday party a few years ago, I was proud to shake the hands of some members of the Fireworks team, giving them my long, overdue tribute as the unsung hero of my creative implementations.</p>
<p>And now, Adobe Fireworks has found a new and valuable home inside my iPhone development workflow. That&#8217;s right, I&#8217;ve been using Fireworks for all my asset creation needs as I march towards completion of my first iPhone game. In fact, the PNG graphics I&#8217;ve created for my game may represent some of the best work I&#8217;ve ever done in the application.</p>
<p>I know I&#8217;m not the only one leveraging Fireworks in this perfect way. It&#8217;s got to be a favorite for other iPhone developers too. But for me, having been such a longtime user and fan, I thought I&#8217;d give the killer application it&#8217;s due.</p>
<p>p.s. Tell your friend Dreamweaver that I love it too.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chuckstar.com/blog/technology/adobe-fireworks-thrives-inside-my-iphone-development-workflow/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>iPhone Sample: Rotating UIImage inside UIImageView</title>
		<link>http://www.chuckstar.com/blog/technology/iphone-sample-rotating-uiimage-inside-uiimageview/</link>
		<comments>http://www.chuckstar.com/blog/technology/iphone-sample-rotating-uiimage-inside-uiimageview/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 01:38:53 +0000</pubDate>
		<dc:creator>chuckstar</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.chuckstar.com/blog/?p=347</guid>
		<description><![CDATA[I was surprised to find out how few samples there were for adding and manipulating images in an iPhone app. Rotating an image seemed to be tricky to figure out, but the code for adding and rotating an image is very simple. The code below shows how to: - Create a UIImage with an image [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.chuckstar.com%2Fblog%2Ftechnology%2Fiphone-sample-rotating-uiimage-inside-uiimageview%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.chuckstar.com%2Fblog%2Ftechnology%2Fiphone-sample-rotating-uiimage-inside-uiimageview%2F&amp;source=chuckstar&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I was surprised to find out how few samples there were for adding and manipulating images in an iPhone app. Rotating an image seemed to be tricky to figure out, but the code for adding and rotating an image is very simple.</p>
<p>The code below shows how to:<br />
- Create a UIImage with an image file<br />
- Create a UIImageView with the dimensions of the UIImage<br />
- Add the UIImage to the UIImageView using the image property<br />
- Add the UIImage to the View<br />
- Create a CGAffineTransform CGAffineTransformMakeRotation<br />
- Apply the CGAffineTransformMakeRotation to the UIImageView</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">UIImage <span style="color: #339933;">*</span>image <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span>UIImage imageNamed<span style="color: #339933;">:</span>@<span style="color: #ff0000;">&quot;image.png&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
UIImageView <span style="color: #339933;">*</span>imageView <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span> <span style="color: #009900;">&#91;</span> UIImageView alloc <span style="color: #009900;">&#93;</span> initWithFrame<span style="color: #339933;">:</span>CGRectMake<span style="color: #009900;">&#40;</span><span style="color:#800080;">0.0</span><span style="color: #339933;">,</span> <span style="color:#800080;">0.0</span><span style="color: #339933;">,</span> image.<span style="color: #202020;">size</span>.<span style="color: #202020;">width</span><span style="color: #339933;">,</span> image.<span style="color: #202020;">size</span>.<span style="color: #202020;">height</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
imageView.<span style="color: #202020;">image</span> <span style="color: #339933;">=</span> image<span style="color: #339933;">;</span>
<span style="color: #009900;">&#91;</span>self addSubview<span style="color: #339933;">:</span>imageView<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
CGAffineTransform rotate <span style="color: #339933;">=</span> CGAffineTransformMakeRotation<span style="color: #009900;">&#40;</span> <span style="color:#800080;">1.0</span> <span style="color: #339933;">/</span> <span style="color:#800080;">180.0</span> <span style="color: #339933;">*</span> <span style="color:#800080;">3.14</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#91;</span>imageView setTransform<span style="color: #339933;">:</span>rotate<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The referenced &#8220;image.png&#8221; needs to be dragged into the Resources folder of your project inside Xcode. This action will prompt you to confirm the copying of the file to the project folder. </p>
<p>To make the image continue to rotate, include the latter two transform lines inside a loop, perhaps dependent on the device&#8217;s acceleration.</p>
<p>If you&#8217;ve got a better, more efficient way of doing the above, please feel free to comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chuckstar.com/blog/technology/iphone-sample-rotating-uiimage-inside-uiimageview/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>iPhone Sample: Adding UILabel programatically</title>
		<link>http://www.chuckstar.com/blog/technology/iphone-sample-adding-uilabel-programatically/</link>
		<comments>http://www.chuckstar.com/blog/technology/iphone-sample-adding-uilabel-programatically/#comments</comments>
		<pubDate>Sat, 04 Jul 2009 02:46:22 +0000</pubDate>
		<dc:creator>chuckstar</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.chuckstar.com/blog/?p=332</guid>
		<description><![CDATA[While developing my first iPhone game App, I&#8217;m finding Interface Builder very easy to use. However, in my coding, I had the need to add a UILabel programatically. Similar to other languages/platforms I&#8217;ve worked with, handling font size, color and weight can be a little confusing. The code below shows how to: - Create new [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.chuckstar.com%2Fblog%2Ftechnology%2Fiphone-sample-adding-uilabel-programatically%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.chuckstar.com%2Fblog%2Ftechnology%2Fiphone-sample-adding-uilabel-programatically%2F&amp;source=chuckstar&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>While developing my first iPhone game App, I&#8217;m finding Interface Builder very easy to use. However, in my coding, I had the need to add a <strong>UILabel</strong> programatically. Similar to other languages/platforms I&#8217;ve worked with, handling font size, color and weight can be a little confusing. </p>
<p>The code below shows how to:<br />
- Create new UILabel<br />
- Set UILabel position (x,y) to center and size<br />
- Set UILabel font alignment, color, font name and size<br />
- Add UILabel to your View<br />
- Populate UILabel with an NSString for text.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">UILabel <span style="color: #339933;">*</span>scoreLabel <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span> <span style="color: #009900;">&#91;</span>UILabel alloc <span style="color: #009900;">&#93;</span> initWithFrame<span style="color: #339933;">:</span>CGRectMake<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>self.<span style="color: #202020;">bounds</span>.<span style="color: #202020;">size</span>.<span style="color: #202020;">width</span> <span style="color: #339933;">/</span> <span style="color: #0000dd;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color:#800080;">0.0</span><span style="color: #339933;">,</span> <span style="color:#800080;">150.0</span><span style="color: #339933;">,</span> <span style="color:#800080;">43.0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
scoreLabel.<span style="color: #202020;">textAlignment</span> <span style="color: #339933;">=</span>  UITextAlignmentCenter<span style="color: #339933;">;</span>
scoreLabel.<span style="color: #202020;">textColor</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span>UIColor whiteColor<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
scoreLabel.<span style="color: #202020;">backgroundColor</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span>UIColor blackColor<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
scoreLabel.<span style="color: #202020;">font</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span>UIFont fontWithName<span style="color: #339933;">:</span>@<span style="color: #ff0000;">&quot;Arial Rounded MT Bold&quot;</span> size<span style="color: #339933;">:</span><span style="color: #009900;">&#40;</span><span style="color:#800080;">36.0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#91;</span>self addSubview<span style="color: #339933;">:</span>scoreLabel<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
scoreLabel.<span style="color: #202020;">text</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span>NSString stringWithFormat<span style="color: #339933;">:</span> @<span style="color: #ff0000;">&quot;%d&quot;</span><span style="color: #339933;">,</span> score<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The score value being set is an <strong>int</strong> that I&#8217;m incrementing based on <strong>CGRectIntersectsRect</strong> of two <strong>UIImageView</strong>s. I&#8217;ll post that example soon.</p>
<p>If you&#8217;ve got a better, more efficient way of doing the above, please feel free to comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chuckstar.com/blog/technology/iphone-sample-adding-uilabel-programatically/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>I am an iPhone developer</title>
		<link>http://www.chuckstar.com/blog/technology/i-am-an-iphone-developer/</link>
		<comments>http://www.chuckstar.com/blog/technology/i-am-an-iphone-developer/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 23:19:28 +0000</pubDate>
		<dc:creator>chuckstar</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.chuckstar.com/blog/?p=309</guid>
		<description><![CDATA[I am an Apple hold out no longer. After decades of resisting and even withstanding years of adoption peer pressure working/living in neighboring towns of Cupertino, I have jumped on the bandwagon. I bought my wife a gen2 iPod Touch, paid $99 to test apps, downloaded/installed the SDK, started playing with examples and have begun [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.chuckstar.com%2Fblog%2Ftechnology%2Fi-am-an-iphone-developer%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.chuckstar.com%2Fblog%2Ftechnology%2Fi-am-an-iphone-developer%2F&amp;source=chuckstar&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img src="http://farm4.static.flickr.com/3184/2932292683_c95dc161f4_m.jpg" alt="Apple picking" /></p>
<p>I am an Apple hold out no longer. After decades of resisting and even withstanding years of adoption peer pressure working/living in neighboring towns of Cupertino, I have jumped on the bandwagon. I bought my wife a gen2 iPod Touch, paid $99 to test apps, downloaded/installed the SDK, started playing with examples and have begun to tear into &#8220;<a href="http://www.amazon.com/gp/product/1430216263?ie=UTF8&#038;tag=mashupexperts-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=1430216263">Beginning iPhone Development</a>&#8221; a.k.a. the grapefruit book (among other references).</p>
<p>As I initially cracked open the macbook pro (on loan) and started up <strong>xcode</strong> for the first time, the years of excuses for holding out so long rushed into my head &#8212; immediately countered by all the reasons I&#8217;m finally IN. If you&#8217;re an able and talented developer that thrives on the (potential of) mass adoption of your work/applications, you may be able to relate to the following:</p>
<p><strong>My excuses for holding out so long:</strong></p>
<p>1. Long and bad history working with Macs. From day 1, 20+ years ago, and especially when I was working tech support at BU getting students online in the mid 90&#8242;s, PC&#8217;s were always easier to work with, install software and customize.</p>
<p>2. My interest in products, especially mobile and other gadgets, is very much need driven. Having been a Windows Mobile device user for 5 years now, I already enjoyed touchscreen, wifi, excellent web browser ability, installed flash player, mp3 playback and many smart phone features. The Apple devices just didn&#8217;t seem to offer much more to me &#8212; if anything, a little less.</p>
<p>3. Recognizing that Apple&#8217;s initial marketing play on the iPhone was as an advanced iTunes player didn&#8217;t interest me as I am not an iTunes customer. I recognize now the brilliance in Apple positioning their device this way towards getting it mainstream adoption.</p>
<p>4. Apple always seemed very &#8220;closed&#8221; to me. They control everything about their products, and while I recognized it&#8217;s the ultimate effort in quality control, it carries with it this imposing and unwelcoming vibe to an innovator like me. This factor also contributes to them not including Flash player on their device, a move that would have had me interested much sooner.</p>
<p><strong>So, having listed my excuses, here are the reasons I&#8217;m no longer holding out:</strong></p>
<p>1. My dad has an iPhone (and so does his wife, as well as my father-in-law, so many of my friends and other very influential colleagues). The iPhone is generating so much buzz around me, it&#8217;s become too hard to ignore.</p>
<p>2. They are selling iPhones and iPods in Walmart. When I saw this, it really dawned on me how mainstream the product has become. Walmart = the ultimate in mainstream adoption and distribution. It means folks across the country, in all remote, un-tech locations, are buying this device &#8212; and more significantly, buying apps to load on to it.</p>
<p>3. My friends are building very cool things on it &#8212; and they&#8217;re having fun doing it. It seems iPhone development has lit a spark for mobile development, something I was hoping Flash Lite would do for many years. [As a career Flash developer, Flash Lite was a natural transition for me to mobile, and something a dabbled in. Like I said, if iPhone had Flash player, I'd be into both a lot more by now.] These same friends are also blogging and talking about their experiences, which is very encouraging.</p>
<p>4. Coding functionality like location, movement (acceleration) and touch proved to be the ultimate enticing factor. Having developed with one primary language for so long, access to new features lured me to test my abilities as a programmer by grasping another platform/language. It was time to challenge myself where the rewards could be so much more than just adding new tools (skills) to the shed.</p>
<p>So, I&#8217;m deep into it now. I&#8217;ve already explored so much functionality and am having a lot of fun. As usual, with any activity not involving your &#8220;day job&#8221;, identifying your own spare time can be just as much a challenge.</p>
<p>Thankfully, my wife has been very supportive, as usual, of me sacrificing TV-couch time with her as I pound out new and un-explored code. After all, as an iPod Touch owner, she&#8217;ll be my first and most enthusiastic customer!</p>
<p>Oh, and just to show I&#8217;m not totally overcome with the thought that the iPhone is the end-all be-all of mobile devices, enjoy this video&#8230;</p>
<p><object width="512" height="328" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="ordie_player_fd7a463dee"><param name="movie" value="http://player.ordienetworks.com/flash/fodplayer.swf" /><param name="flashvars" value="key=fd7a463dee" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always"></param><embed width="512" height="328" flashvars="key=fd7a463dee" allowfullscreen="true" allowscriptaccess="always" quality="high" src="http://player.ordienetworks.com/flash/fodplayer.swf" name="ordie_player_fd7a463dee" type="application/x-shockwave-flash"></embed></object>
<div style="text-align:left;font-size:x-small;margin-top:0;width:512px;"><a href="http://www.funnyordie.com/videos/fd7a463dee/iphone-emergency" title="from garagerobpictures">iPhone Emergency</a> &#8211; watch more <a href="http://www.funnyordie.com/" title="on Funny or Die">funny videos</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.chuckstar.com/blog/technology/i-am-an-iphone-developer/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

