<?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>iCodeBlog</title>
	<atom:link href="http://icodeblog.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://icodeblog.com</link>
	<description>iPhone Programming Tutorials</description>
	<lastBuildDate>Thu, 12 Aug 2010 21:43:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>iPhone Apps for The TV?</title>
		<link>http://icodeblog.com/2010/08/12/iphone-apps-for-the-tv/</link>
		<comments>http://icodeblog.com/2010/08/12/iphone-apps-for-the-tv/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 21:43:38 +0000</pubDate>
		<dc:creator>wolfgang</dc:creator>
				<category><![CDATA[AppStore]]></category>

		<guid isPermaLink="false">http://icodeblog.com/?p=2219</guid>
		<description><![CDATA[<a href="http://icodeblog.com/2010/08/12/iphone-apps-for-the-tv/"><img align="left" hspace="5" width="150" height="150" src="http://icodeblog.com/wp-content/uploads/2010/06/appstore-150x150.jpg" class="alignleft tfe wp-post-image" alt="appstore" title="appstore" /></a>There are some interesting rumors coming from the usual suspects, suggesting that Apple’s fall product update will not only bring the expected iPod refresh, but also a new Apple TV that may be called iTV. The interesting piece of that rumor is that the new set-top box may include the A4 processor and run on iOS 4.]]></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%2Ficodeblog.com%2F2010%2F08%2F12%2Fiphone-apps-for-the-tv%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ficodeblog.com%2F2010%2F08%2F12%2Fiphone-apps-for-the-tv%2F&amp;source=elctech&amp;style=normal&amp;hashtags=%23iphonedev" height="61" width="50" /><br />
			</a>
		</div>
<p>There are some interesting rumors coming from the usual suspects, suggesting that Apple’s fall product update will not only bring the expected iPod refresh, but also a new Apple TV that may be called iTV. The interesting piece of that rumor is that the new set-top box may include the A4 processor and run on iOS 4.</p>
<p>Such a product would be consistent with Apple’s product strategy and even if some voiced some disappointment that the iTV may be stuck at 720p, there is the logical assumption that it will connect to the App Store. And if it does, it will open up apps to even larger displays than the iPad – your TV. Imagine running your app on a TV. What could it do? What about casual gaming on a TV? It’s entirely possible with an iOS-based iTV.</p>
<p>We may be speculating a bit here, but we believe that Apple will continue to eliminate the borders between different types of devices and eventually allow mobile, desktop and consumer electronics to access the App Store. The implications for iTV include the fact that the box may be bridging the gap into the gaming world and turn into a game console as well. If so, imagine iPods or iPhones to be used as game controllers. There is a whole new opportunity out there, provided Apple will take this step, which we do not know for sure will actually be the case.</p>
<p>However, it may be a good idea to start thinking about Apps that run on much higher resolutions than on the standard iPhone and iPad screen.</p>
]]></content:encoded>
			<wfw:commentRss>http://icodeblog.com/2010/08/12/iphone-apps-for-the-tv/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Facebook Updates SDK For iOS</title>
		<link>http://icodeblog.com/2010/08/12/facebook-updates-sdk-for-ios/</link>
		<comments>http://icodeblog.com/2010/08/12/facebook-updates-sdk-for-ios/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 21:34:52 +0000</pubDate>
		<dc:creator>wolfgang</dc:creator>
				<category><![CDATA[ipad]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://icodeblog.com/?p=2215</guid>
		<description><![CDATA[<a href="http://icodeblog.com/2010/08/12/facebook-updates-sdk-for-ios/"><img align="left" hspace="5" width="150" height="150" src="http://icodeblog.com/wp-content/uploads/2010/06/ios4-150x150.jpg" class="alignleft tfe wp-post-image" alt="ios4" title="ios4" /></a>Facebook has updated its SDK for iOSfor iPhone, iPod Touch and iPad apps. The big news is that this new SDK enables the use of the Graph UI amd allows authentication with OAuth 2.0.]]></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%2Ficodeblog.com%2F2010%2F08%2F12%2Ffacebook-updates-sdk-for-ios%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ficodeblog.com%2F2010%2F08%2F12%2Ffacebook-updates-sdk-for-ios%2F&amp;source=elctech&amp;style=normal&amp;hashtags=iOS" height="61" width="50" /><br />
			</a>
		</div>
<p>Facebook has updated its SDK for iOSfor iPhone, iPod Touch and iPad apps. The big news is that this new SDK enables the use of the Graph UI and allows authentication with OAuth 2.0.</p>
<p>According to Facebook, more than 150 million people are using a mobile version of Facebook and the company intends to take its mobile app environment closer to where its desktop development stands.</p>
<p>Facebook said that it encourages developers to upgrade to the new SDK, but it will continue to support the older SDK for the “foreseeable future.” You can download the kit and find all information <a href="http://github.com/facebook/facebook-ios-sdk">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://icodeblog.com/2010/08/12/facebook-updates-sdk-for-ios/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>That Flash on the iPhone</title>
		<link>http://icodeblog.com/2010/08/09/that-flash-on-the-iphone/</link>
		<comments>http://icodeblog.com/2010/08/09/that-flash-on-the-iphone/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 22:36:20 +0000</pubDate>
		<dc:creator>wolfgang</dc:creator>
				<category><![CDATA[iphone]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://icodeblog.com/?p=2212</guid>
		<description><![CDATA[<a href="http://icodeblog.com/2010/08/09/that-flash-on-the-iphone/"><img align="left" hspace="5" width="150" height="150" src="http://icodeblog.com/wp-content/uploads/2010/07/applelogo1-150x150.jpg" class="alignleft tfe wp-post-image" alt="applelogo" title="applelogo" /></a>I am not quite sure how often Flash has been discussed on the iPhone and how often we have seen prototypes running on it. Given the development of HTML5 as well as the memory and battery issues that come with Flash, Flash is turning out to be a nice-to-have feature and not so much a must have. But if you really must run Flash on an iPhone, now you can, thanks to Frash that runs on jailbroken iPhones. We haven’t tested it yet, but we thought you would like to know. If you run it, keep in mind that Comex says that Frash is not what you would describe as stable.]]></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%2Ficodeblog.com%2F2010%2F08%2F09%2Fthat-flash-on-the-iphone%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ficodeblog.com%2F2010%2F08%2F09%2Fthat-flash-on-the-iphone%2F&amp;source=elctech&amp;style=normal&amp;hashtags=flash,iphone" height="61" width="50" /><br />
			</a>
		</div>
<p>I am not quite sure how often Flash has been discussed on the iPhone and how often we have seen prototypes running on it. Given the development of HTML5 as well as the memory and battery issues that come with Flash, Flash is turning out to be a nice-to-have feature and not so much a must have. But if you really must run Flash on an iPhone, <a href="http://github.com/comex/frash">now you can</a>, thanks to Frash that runs on jailbroken iPhones. We haven’t tested it yet, but we thought you would like to know. If you run it, keep in mind that Comex says that Frash is not what you would describe as stable.</p>
<p>Of course, there is now an interesting legal situation that legalizes jailbreaking, even if such a move still voids the warranty of the iPhone. We doubt that Flash will become a major deal on the iPhoen, but it is worth watching whether this story develops.</p>
<p>Apple is unlikely to change its opinion and if you forget Mark Papermaster’s <a href="http://www.macrumors.com/2010/08/08/papermasters-departure-linked-to-cultural-incompatibility-rather-than-antenna-issues/">departure </a>from the company, it is rather quiet about the phone lately. Despite the success of Android, Apple appears to be still selling every iPhone it can make and the Apple Store still says that there is a delay between your order and actual delivery. Sterne Agee analyst Vijay Rakesh this morning told investors that Apple is likely to address this situation, especially since the iPhone 4 is making its way to a total of 88 countries by the end of September. Q3 orders have been increased to more than 10 million, according to Rakesh, which would translate into a 20% production increase over Q2.</p>
<p>We should see data and app use still increase over the next months. For those of you who are keeping track of the numbers, Google recently said that Android is selling some 6 million phones every month now.</p>
]]></content:encoded>
			<wfw:commentRss>http://icodeblog.com/2010/08/09/that-flash-on-the-iphone/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>iPad App Store Gets Genius, Try Before You Buy</title>
		<link>http://icodeblog.com/2010/08/06/ipad-app-store-gets-genius-try-before-you-buy/</link>
		<comments>http://icodeblog.com/2010/08/06/ipad-app-store-gets-genius-try-before-you-buy/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 21:58:49 +0000</pubDate>
		<dc:creator>wolfgang</dc:creator>
				<category><![CDATA[ipad]]></category>

		<guid isPermaLink="false">http://icodeblog.com/?p=2209</guid>
		<description><![CDATA[<a href="http://icodeblog.com/2010/08/06/ipad-app-store-gets-genius-try-before-you-buy/"><img align="left" hspace="5" width="150" height="150" src="http://icodeblog.com/wp-content/uploads/2010/06/appstore-150x150.jpg" class="alignleft tfe wp-post-image" alt="appstore" title="appstore" /></a>Demo versions have always been a big part of software download stores on the Internet - just not so much for the App Store, which in the end, created an environment of “lite” versions and, if we believe Mashable, also software piracy. Piracy is unlikely to go away entirely, but there is now a new try before you buy section in the App Store that may discourage piracy somewhat. And, Apple quietly introduced Genius as a new feature for the App Store.]]></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%2Ficodeblog.com%2F2010%2F08%2F06%2Fipad-app-store-gets-genius-try-before-you-buy%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ficodeblog.com%2F2010%2F08%2F06%2Fipad-app-store-gets-genius-try-before-you-buy%2F&amp;source=elctech&amp;style=normal&amp;hashtags=%23iphonedev" height="61" width="50" /><br />
			</a>
		</div>
<p>Demo versions have always been a big part of software download stores on the Internet &#8211; just not so much for the App Store, which in the end, created an environment of “lite” versions and, if we believe Mashable, also software piracy. Piracy is unlikely to go away entirely, but there is now a new try before you buy section in the App Store that may discourage piracy somewhat. And, Apple quietly introduced Genius as a new feature for the App Store.</p>
<p>Apple was never especially receptive for demo versions and that has not changed yet. However, lite versions are now specifically available in a try before you buy section. You can always argue what may have prompted Apple to introduce the feature. Perhaps it was just about time, considering the fact that there are more and more users and more and more apps – and sometimes you just don’t want to pay before you have not seen what an app can do. Mashable, however, believes that Apple may think that this category may prevent a scenario of would-be pirates – users who just don’t want to pay before they have tried the app.</p>
<p>The iPad App Store now has a Genius tab, enabling users to find new apps depending on the Apps they already have. While the feature was added quietly and there isn’t much information available, it appears that the Genius feature only recommends apps with a 2-star rating or higher. That is rather unfortunate for those apps that do not have a rating yet, but surely helps to get to the higher quality apps first. However, it means that good ratings will get even more important for apps and while the Genius feature is marketing help provided by Apple, it requires that you do your homework first – and get a good rating in the first place.</p>
<p>For those who keep count, there are more than 225,000 apps in Apple’s App Store.</p>
]]></content:encoded>
			<wfw:commentRss>http://icodeblog.com/2010/08/06/ipad-app-store-gets-genius-try-before-you-buy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Is it iPhone 5 time already?</title>
		<link>http://icodeblog.com/2010/08/04/is-it-iphone-5-time-already/</link>
		<comments>http://icodeblog.com/2010/08/04/is-it-iphone-5-time-already/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 03:07:19 +0000</pubDate>
		<dc:creator>wolfgang</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://icodeblog.com/?p=2203</guid>
		<description><![CDATA[<a href="http://icodeblog.com/2010/08/04/is-it-iphone-5-time-already/"><img align="left" hspace="5" width="150" height="150" src="http://icodeblog.com/wp-content/uploads/2010/08/phonecalls-150x150.jpg" class="alignleft tfe wp-post-image" alt="phonecalls" title="phonecalls" /></a>This one seems to be a bit early. It isn’t quite Apple rumor time and it surely is not the time for a new iPhone to be discussed. Or is it?]]></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%2Ficodeblog.com%2F2010%2F08%2F04%2Fis-it-iphone-5-time-already%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ficodeblog.com%2F2010%2F08%2F04%2Fis-it-iphone-5-time-already%2F&amp;source=elctech&amp;style=normal&amp;hashtags=%23iphonedev" height="61" width="50" /><br />
			</a>
		</div>
<p>This one seems to be a bit early. It isn’t quite Apple rumor time and it surely is not the time for a new iPhone to be discussed. Or is it?</p>
<p>The whole iPhone 4 antenna drama has spawned a new <a href="http://www.ilounge.com/index.php/backstage/comments/leaked-details-on-2010-2011-ipods-iphone-5-bumper-2-ipad-mini/">round of rumors</a>, iPhone 5 rumors. One of those industry sources suggested that Apple is pushing up the release of the fifth generation iPhone up to early January 2011 to deal with the antenna issue. Sort of a redesigned iPhone 4. That is a tough one to believe, but then we never know. By the way, Apple just deleted the antenna performance comparison videos from its website. There was no information why that happened, but we think it is a good idea. A justification has never been really necessary anyway.</p>
<p>Besides the new iPhone 5, rumor has it that there will also be a smaller iPad with a screen size of seven inches. The source also talks about an iPod nano, a shuffle with a small 1.7” screen as well as the new iPod touch. There is one more product update cycle in September and there is no doubt in our mind that Apple will be updating its iPods then. It will be interesting to see how far Apple will take its iOS, whether it will make it into the nano or whether Apple will put a much stronger focus on the touch, which was highlighted by the company as the reason why the iPod line can still deliver somewhat stable revenues during Apple’s most recent earnings conference.</p>
<p>The iPhone 5 got us thinking though. Apple rumors have been very accurate lately, but it seems more likely that Apple will just redesign the iPhone 4, which may be feasible until January 2011 and a subsequent release. An entirely phone, which would also spark a discussion of a new iOS may be a bit optimistic. </p>
]]></content:encoded>
			<wfw:commentRss>http://icodeblog.com/2010/08/04/is-it-iphone-5-time-already/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>iPhone Maintains the Edge in Web Usage</title>
		<link>http://icodeblog.com/2010/08/03/iphone-maintains-the-edge-in-web-usage/</link>
		<comments>http://icodeblog.com/2010/08/03/iphone-maintains-the-edge-in-web-usage/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 22:32:39 +0000</pubDate>
		<dc:creator>wolfgang</dc:creator>
				<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://icodeblog.com/?p=2198</guid>
		<description><![CDATA[<a href="http://icodeblog.com/2010/08/03/iphone-maintains-the-edge-in-web-usage/"><img align="left" hspace="5" width="150" height="150" src="http://icodeblog.com/wp-content/uploads/2010/07/iphone4-150x150.jpg" class="alignleft tfe wp-post-image" alt="iphone4" title="iphone4" /></a>There are some now statistics out that indicate an extremely high product loyalty among iPhone users as well as impressive web usage that is most likely fueled by the iPhone 4.]]></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%2Ficodeblog.com%2F2010%2F08%2F03%2Fiphone-maintains-the-edge-in-web-usage%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ficodeblog.com%2F2010%2F08%2F03%2Fiphone-maintains-the-edge-in-web-usage%2F&amp;source=elctech&amp;style=normal&amp;hashtags=iphone" height="61" width="50" /><br />
			</a>
		</div>
<p>There are some now statistics out that indicate an extremely high product loyalty among iPhone users as well as impressive web usage that is most likely fueled by the iPhone 4.</p>
<p>Net Applications <a href="http://www.netmarketshare.com/operating-system-market-share.aspx?qprid=9&amp;qpcustom=iPhone&amp;sample=34">found </a>that 0.70% of all web browsing now originates from iPhones. That may not sound much, but that is close to the web traffic posted by Linux systems, which is now at 0.93%, according to the market research firm. Mac OS X 10.5’s share, by the way, is at 1.82% and Mac OS X 10.6 stands at 2.48%, which shows that 0.70% from a smart phone is a big deal: The iPhone has gained 0.11 points in July alone, which was largest single-month usage gain ever. Android, by the way is estimated at a total web usage share of 0.18%.</p>
<p>Nielsen has <a href="http://blog.nielsen.com/nielsenwire/online_mobile/android-soars-but-iphone-still-most-desired-as-smartphones-grab-25-of-u-s-mobile-market/">released </a>some charts that highlight the user loyalty of the iPhone. 89% of iPhone users intend to buy another iPhone, while 6% say they want to switch to Android and 2% say they are looking for a Blackberry. 71% of Android users say they want another Android phone, but 21% want an iPhone next. 29% of Blackberry owners are likely to switch to an iPhone and 21% to an Android phone.</p>
<p>Android seems to be gaining market momentum especially in the U.S. Nielsen said that 27% of new smartphone acquisitions went to Android in the second quarter of the year and only 23% to the iPhone. </p>
]]></content:encoded>
			<wfw:commentRss>http://icodeblog.com/2010/08/03/iphone-maintains-the-edge-in-web-usage/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Black Sheep: Free iPhone Apps Snoop Contacts</title>
		<link>http://icodeblog.com/2010/07/29/the-black-sheep-free-iphone-apps-snoop-contacts/</link>
		<comments>http://icodeblog.com/2010/07/29/the-black-sheep-free-iphone-apps-snoop-contacts/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 21:43:46 +0000</pubDate>
		<dc:creator>wolfgang</dc:creator>
				<category><![CDATA[AppStore]]></category>
		<category><![CDATA[app store]]></category>

		<guid isPermaLink="false">http://icodeblog.com/?p=2194</guid>
		<description><![CDATA[<a href="http://icodeblog.com/2010/07/29/the-black-sheep-free-iphone-apps-snoop-contacts/"><img align="left" hspace="5" width="150" height="150" src="http://icodeblog.com/wp-content/uploads/2010/06/iphoneicode-150x150.jpg" class="alignleft tfe wp-post-image" alt="iphoneicode" title="iphoneicode" /></a>Blackhat has started and not surprisingly, there is quite a bit of information coming out of Las Vegas that relates to the iPhone. Lookout revealed some results from its App Genome project, which analyzed about 300,000 apps that are available [...]]]></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%2Ficodeblog.com%2F2010%2F07%2F29%2Fthe-black-sheep-free-iphone-apps-snoop-contacts%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ficodeblog.com%2F2010%2F07%2F29%2Fthe-black-sheep-free-iphone-apps-snoop-contacts%2F&amp;source=elctech&amp;style=normal&amp;hashtags=app+store" height="61" width="50" /><br />
			</a>
		</div>
<p>Blackhat has started and not surprisingly, there is quite a bit of information coming out of Las Vegas that relates to the iPhone. Lookout <a href="http://blog.mylookout.com/2010/07/introducing-the-app-genome-project/">revealed</a> some results from its App Genome project, which analyzed about 300,000 apps that are available for the iPhone and Android. Sometimes you get what you pay for and that may be true in the case of iPhone apps as well, in a rather negative way.</p>
<p>Lookout said that one third of free applications for the iPhone can potentially access a user’s location. 14% can access a user’s contacts and 23 of iPhone apps contain third party code. According to the company, new vulnerabilities will be unveiled at Blackhat, including mobile data leakage, which, however, seems to affect Android more than the iPhone.</p>
<p>Lookout noted that App developers need to “be more aware of best practices for accessing, transmitting and storing users’ personal data. In addition, consumers need to be aware of the permissions that mobile applications request and how that personal data is being used in the application.“</p>
<p>Sounds reasonable to us. Given its exposure, the iPhone has become a very attractive target platform for malicious intent. And boy, opening up the platform to all apps, whether they are App Store certified or not, may create an entirely different dimension of software threats. </p>
]]></content:encoded>
			<wfw:commentRss>http://icodeblog.com/2010/07/29/the-black-sheep-free-iphone-apps-snoop-contacts/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>iPhone Programming Tutorial &#8211; Local Notifications</title>
		<link>http://icodeblog.com/2010/07/29/iphone-programming-tutorial-local-notifications/</link>
		<comments>http://icodeblog.com/2010/07/29/iphone-programming-tutorial-local-notifications/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 19:26:53 +0000</pubDate>
		<dc:creator>brandontreb</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[iPhone Programming Tutorials]]></category>
		<category><![CDATA[alert]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[uilocalnotification]]></category>

		<guid isPermaLink="false">http://icodeblog.com/?p=2165</guid>
		<description><![CDATA[<a href="http://icodeblog.com/2010/07/29/iphone-programming-tutorial-local-notifications/"><img align="left" hspace="5" width="150" height="150" src="http://icodeblog.com/wp-content/uploads/2010/07/Screen-shot-2010-07-29-at-11.28.46-AM-150x150.png" class="alignleft tfe wp-post-image" alt="Screen shot 2010-07-29 at 11.28.46 AM" title="Screen shot 2010-07-29 at 11.28.46 AM" /></a>Way back when, when everyone was still complaining about Apple's lack of support for (3rd party) multitasking, there was a simple solution put in place. This solution was known as push notifications.

Push notifications solved many of the issues associated with background processing.  For example, when quitting the AIM application, the server could keep you logged in and send you a push notification when a new message arrived.  You could then tap on a View button that would launch the app.

This solution is great and all, but it still requires that you have an active internet connection.  As of iOS4, Apple has introduced a new type of notification that can be scheduled to fire within the device itself.  It requires no complicated server programming, or additional configuration with iTunes.  I am talking about Local Notifications.]]></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%2Ficodeblog.com%2F2010%2F07%2F29%2Fiphone-programming-tutorial-local-notifications%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ficodeblog.com%2F2010%2F07%2F29%2Fiphone-programming-tutorial-local-notifications%2F&amp;source=elctech&amp;style=normal&amp;hashtags=alert,iphone,uilocalnotification" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://icodeblog.com/wp-content/uploads/2010/07/Screen-shot-2010-07-29-at-11.31.32-AM.png"><img class="size-full wp-image-2181 alignright" title="Screen shot 2010-07-29 at 11.31.32 AM" src="http://icodeblog.com/wp-content/uploads/2010/07/Screen-shot-2010-07-29-at-11.31.32-AM.png" alt="" width="289" height="398" /></a>Way back when, when everyone was still complaining about Apple&#8217;s lack of support for (3rd party) multitasking, there was a simple solution put in place. This solution was known as push notifications.</p>
<p>Push notifications solved many of the issues associated with background processing.  For example, when quitting the AIM application, the server could keep you logged in and send you a push notification when a new message arrived.  You could then tap on a View button that would launch the app.</p>
<p>This solution is great and all, but it still requires that you have an active internet connection.  As of iOS4, Apple has introduced a new type of notification that can be scheduled to fire within the device itself.  It requires no complicated server programming, or additional configuration with iTunes.  I am talking about <strong>Local Notifications</strong>.</p>
<p>Local notifications can be scheduled on the user&#8217;s iDevice to fire at any given time; you can even set them to be recurring.  Today, we will explore these notifications and I will provide you with a simple example of how to schedule, view, and handle local notifications.  Here is a quick screenshot of the project that we are going to create (note I am using the iPhone 4  simulator).</p>
<p style="text-align: center;"><a href="http://icodeblog.com/wp-content/uploads/2010/07/Screen-shot-2010-07-29-at-11.28.46-AM.png"><img class="alignnone size-full wp-image-2168" title="Screen shot 2010-07-29 at 11.28.46 AM" src="http://icodeblog.com/wp-content/uploads/2010/07/Screen-shot-2010-07-29-at-11.28.46-AM.png" alt="" width="482" height="664" /></a></p>
<p style="text-align: left;">The project will allow a user to schedule a location notification to fire off at a given date.  Using the text field, they are also able to specify some text for the notification.  The table view below displays a list of all of the currently scheduled location notifications within the application.</p>
<p style="text-align: left;">So, by now (if you are an avid iCodeBlog reader), you are already a killer iPhone dev and I can rush through the stuff that is not related to the notifications.  I will try to provide links to tutorials about sections that I rush through as well.</p>
<h2>1. Create a View-Based Application</h2>
<p style="text-align: left;">We will be using this as our starting point.  Check out <a href="http://icodeblog.com/2008/07/29/iphone-programming-tutorial-beginner-interface-builder-hello-world/">this tutorial</a> if you are unfamiliar with doing this.  Name the project <strong>Notifier</strong>.</p>
<h2>2. Create All Properties and Dummy IBActions</h2>
<p style="text-align: left;">This is usually a good first step when tackling an application like this.  Let&#8217;s get everything set up in the .h and .m files so we only have to visit Interface Builder Once.  Here is what our NotifierViewController.h file looks like.</p>
<p style="text-align: left;">

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #a61390;">@interface</span> NotifierViewController <span style="color: #002200;">:</span> UIViewController<span style="color: #002200;">&amp;</span>lt;UITableViewDelegate,UITableViewDataSource<span style="color: #002200;">&amp;</span>gt; <span style="color: #002200;">&#123;</span>
	IBOutlet UITableView <span style="color: #002200;">*</span>tableview;
	IBOutlet UIDatePicker <span style="color: #002200;">*</span>datePicker;
	IBOutlet UITextField <span style="color: #002200;">*</span>eventText;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #a61390;">@property</span> <span style="color: #002200;">&#40;</span>nonatomic, retain<span style="color: #002200;">&#41;</span> IBOutlet UITableView <span style="color: #002200;">*</span>tableview;
<span style="color: #a61390;">@property</span> <span style="color: #002200;">&#40;</span>nonatomic, retain<span style="color: #002200;">&#41;</span> IBOutlet UIDatePicker <span style="color: #002200;">*</span>datePicker;
<span style="color: #a61390;">@property</span> <span style="color: #002200;">&#40;</span>nonatomic, retain<span style="color: #002200;">&#41;</span> IBOutlet UITextField <span style="color: #002200;">*</span>eventText;
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>IBAction<span style="color: #002200;">&#41;</span> scheduleAlarm<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span> sender;
&nbsp;
<span style="color: #a61390;">@end</span></pre></div></div>

<p style="text-align: left;">Seems clear enough.  We have 3 UI elements that we care about and one action.  One thing to note is, your class should implement the UITableViewDelegate and UITableViewDataSource protocols.  This is because we will be displaying a tableview containing all of the scheduled alarms.</p>
<p style="text-align: left;">Now, do all of the necessary steps in your .m file.  This includes memory management for the IBOutlets and creating a dummy method for the scheduleAlarm IBAction.  Your .m file should look something like this.  Note: I have omitted import statements because my syntax highlighter wasn&#8217;t digging them.</p>
<p style="text-align: left;">

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #a61390;">@implementation</span> NotifierViewController
&nbsp;
<span style="color: #a61390;">@synthesize</span> datePicker,tableview, eventText;
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>IBAction<span style="color: #002200;">&#41;</span> scheduleAlarm<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span> sender <span style="color: #002200;">&#123;</span>
&nbsp;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>didReceiveMemoryWarning <span style="color: #002200;">&#123;</span>
    <span style="color: #002200;">&#91;</span>super didReceiveMemoryWarning<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>viewDidUnload <span style="color: #002200;">&#123;</span>
	datePicker <span style="color: #002200;">=</span> <span style="color: #a61390;">nil</span>;
	tableview <span style="color: #002200;">=</span> <span style="color: #a61390;">nil</span>;
	eventText <span style="color: #002200;">=</span> <span style="color: #a61390;">nil</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>dealloc <span style="color: #002200;">&#123;</span>
    <span style="color: #002200;">&#91;</span>super dealloc<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #a61390;">@end</span></pre></div></div>

<p style="text-align: left;">Now it&#8217;s time to build our interface.  Open Interface builder and construct an interface like this.</p>
<p style="text-align: center;"><a href="http://icodeblog.com/wp-content/uploads/2010/07/Screen-shot-2010-07-29-at-10.52.35-AM.png"><img class="alignnone size-full wp-image-2174" title="Screen shot 2010-07-29 at 10.52.35 AM" src="http://icodeblog.com/wp-content/uploads/2010/07/Screen-shot-2010-07-29-at-10.52.35-AM.png" alt="" width="400" height="582" /></a></p>
<p style="text-align: left;">If you want my super sweet green button image, here it is:</p>
<p style="text-align: center;"><a href="http://icodeblog.com/wp-content/uploads/2010/07/button-green.png"><img class="size-full wp-image-2175 aligncenter" title="button-green" src="http://icodeblog.com/wp-content/uploads/2010/07/button-green.png" alt="" width="292" height="47" /></a></p>
<p style="text-align: left;">After creating the interface, make sure you hook up all of the UI components to their corresponding IBOutlets and hook up the touchUpInside: method of the button the your scheduleAlarm: IBAction.  For more info on hooking up IBOutlets, check out <a href="http://icodeblog.com/2008/07/30/iphone-programming-tutorial-connecting-code-to-an-interface-builder-view/">this tutorial</a>.</p>
<h2>3. Implement UITableViewDelegate and UITableViewDataSource Delegate methods to List Currently Scheduled Local Notifications</h2>
<p style="text-align: left;">It may seem weird to implement the code to display the notifications before the code that creates them, however I like this approach better.  This way, once we schedule the notifications, they automagically appear in our table.  Add the following code to your .m file.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>NSInteger<span style="color: #002200;">&#41;</span>numberOfSectionsInTableView<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UITableView <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>tableView <span style="color: #002200;">&#123;</span>
    <span style="color: #11740a; font-style: italic;">// We only have one section</span>
    <span style="color: #a61390;">return</span> <span style="color: #2400d9;">1</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>NSInteger<span style="color: #002200;">&#41;</span>tableView<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UITableView <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>tableView numberOfRowsInSection<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>NSInteger<span style="color: #002200;">&#41;</span>section <span style="color: #002200;">&#123;</span>
    <span style="color: #11740a; font-style: italic;">// Return the number of notifications</span>
    <span style="color: #a61390;">return</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIApplication sharedApplication<span style="color: #002200;">&#93;</span> scheduledLocalNotifications<span style="color: #002200;">&#93;</span> count<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>UITableViewCell <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>tableView<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UITableView <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>tableView cellForRowAtIndexPath<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSIndexPath</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>indexPath <span style="color: #002200;">&#123;</span>
&nbsp;
    <span style="color: #a61390;">static</span> <span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>CellIdentifier <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Cell&quot;</span>;
&nbsp;
    UITableViewCell <span style="color: #002200;">*</span>cell <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>tableView dequeueReusableCellWithIdentifier<span style="color: #002200;">:</span>CellIdentifier<span style="color: #002200;">&#93;</span>;
    <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>cell <span style="color: #002200;">==</span> <span style="color: #a61390;">nil</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
        cell <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UITableViewCell alloc<span style="color: #002200;">&#93;</span> initWithStyle<span style="color: #002200;">:</span>UITableViewCellStyleSubtitle reuseIdentifier<span style="color: #002200;">:</span>CellIdentifier<span style="color: #002200;">&#93;</span> autorelease<span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#125;</span>
&nbsp;
    <span style="color: #11740a; font-style: italic;">// Get list of local notifications</span>
    <span style="color: #400080;">NSArray</span> <span style="color: #002200;">*</span>notificationArray <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIApplication sharedApplication<span style="color: #002200;">&#93;</span> scheduledLocalNotifications<span style="color: #002200;">&#93;</span>;
    UILocalNotification <span style="color: #002200;">*</span>notif <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>notificationArray objectAtIndex<span style="color: #002200;">:</span>indexPath.row<span style="color: #002200;">&#93;</span>;
&nbsp;
    <span style="color: #11740a; font-style: italic;">// Display notification info</span>
    <span style="color: #002200;">&#91;</span>cell.textLabel setText<span style="color: #002200;">:</span>notif.alertBody<span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#91;</span>cell.detailTextLabel setText<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>notif.fireDate description<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
&nbsp;
    <span style="color: #a61390;">return</span> cell;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p style="text-align: left;">OK, finally some &#8220;real&#8221; code.  Most of this code should seem pretty straight forward.  If not, <a href="http://icodeblog.com/2008/08/08/iphone-programming-tutorial-populating-uitableview-with-an-nsarray/">check out this tutorial</a> on UITableViews.</p>
<p style="text-align: left;">So, the new code here is dealing with retrieving a list of scheduled notifications.  Calling the scheduledLocalNotifications method of UIApplication will return an NSArray of all notifications scheduled by the current app.  We just index into this array and grab each notification.</p>
<p style="text-align: left;">Finally, we are displaying the alertBody (text that displays when the notification fires) and the fireDate (date and time when the notification will display) in the tableview cell.</p>
<h2>4. Scheduling Notifications</h2>
<p>And now for the moment you&#8217;ve been waiting for&#8230; OK, probably not, but definitely the most exciting (least boring) part of this tutorial.  Let&#8217;s implement that scheduleAlarm: IBAction that you framed out earlier.  Update your .m file to contain the following code.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>IBAction<span style="color: #002200;">&#41;</span> scheduleAlarm<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span> sender <span style="color: #002200;">&#123;</span>
    <span style="color: #002200;">&#91;</span>eventText resignFirstResponder<span style="color: #002200;">&#93;</span>;
&nbsp;
    <span style="color: #400080;">NSCalendar</span> <span style="color: #002200;">*</span>calendar <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSCalendar</span> autoupdatingCurrentCalendar<span style="color: #002200;">&#93;</span>;
&nbsp;
    <span style="color: #11740a; font-style: italic;">// Get the current date</span>
    <span style="color: #400080;">NSDate</span> <span style="color: #002200;">*</span>pickerDate <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>self.datePicker date<span style="color: #002200;">&#93;</span>;
&nbsp;
    <span style="color: #11740a; font-style: italic;">// Break the date up into components</span>
    <span style="color: #400080;">NSDateComponents</span> <span style="color: #002200;">*</span>dateComponents <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>calendar components<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span> NSYearCalendarUnit | NSMonthCalendarUnit |  NSDayCalendarUnit <span style="color: #002200;">&#41;</span>
												   fromDate<span style="color: #002200;">:</span>pickerDate<span style="color: #002200;">&#93;</span>;
    <span style="color: #400080;">NSDateComponents</span> <span style="color: #002200;">*</span>timeComponents <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>calendar components<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span> NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit <span style="color: #002200;">&#41;</span>
												   fromDate<span style="color: #002200;">:</span>pickerDate<span style="color: #002200;">&#93;</span>;
    <span style="color: #11740a; font-style: italic;">// Set up the fire time</span>
    <span style="color: #400080;">NSDateComponents</span> <span style="color: #002200;">*</span>dateComps <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSDateComponents</span> alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#91;</span>dateComps setDay<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>dateComponents day<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#91;</span>dateComps setMonth<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>dateComponents month<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#91;</span>dateComps setYear<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>dateComponents year<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#91;</span>dateComps setHour<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>timeComponents hour<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #11740a; font-style: italic;">// Notification will fire in one minute</span>
    <span style="color: #002200;">&#91;</span>dateComps setMinute<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>timeComponents minute<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>dateComps setSecond<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>timeComponents second<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
    <span style="color: #400080;">NSDate</span> <span style="color: #002200;">*</span>itemDate <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>calendar dateFromComponents<span style="color: #002200;">:</span>dateComps<span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#91;</span>dateComps release<span style="color: #002200;">&#93;</span>;
&nbsp;
    UILocalNotification <span style="color: #002200;">*</span>localNotif <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UILocalNotification alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;
    <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>localNotif <span style="color: #002200;">==</span> <span style="color: #a61390;">nil</span><span style="color: #002200;">&#41;</span>
        <span style="color: #a61390;">return</span>;
    localNotif.fireDate <span style="color: #002200;">=</span> itemDate;
    localNotif.timeZone <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSTimeZone</span> defaultTimeZone<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #11740a; font-style: italic;">// Notification details</span>
    localNotif.alertBody <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>eventText text<span style="color: #002200;">&#93;</span>;
	<span style="color: #11740a; font-style: italic;">// Set the action button</span>
    localNotif.alertAction <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;View&quot;</span>;
&nbsp;
    localNotif.soundName <span style="color: #002200;">=</span> UILocalNotificationDefaultSoundName;
    localNotif.applicationIconBadgeNumber <span style="color: #002200;">=</span> <span style="color: #2400d9;">1</span>;
&nbsp;
	<span style="color: #11740a; font-style: italic;">// Specify custom data for the notification</span>
    <span style="color: #400080;">NSDictionary</span> <span style="color: #002200;">*</span>infoDict <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSDictionary</span> dictionaryWithObject<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;someValue&quot;</span> forKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;someKey&quot;</span><span style="color: #002200;">&#93;</span>;
    localNotif.userInfo <span style="color: #002200;">=</span> infoDict;
&nbsp;
	<span style="color: #11740a; font-style: italic;">// Schedule the notification</span>
    <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIApplication sharedApplication<span style="color: #002200;">&#93;</span> scheduleLocalNotification<span style="color: #002200;">:</span>localNotif<span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#91;</span>localNotif release<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #002200;">&#91;</span>self.tableview reloadData<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>So, most of the explanation is in the comments.  I&#8217;ll talk you through some of the less obvious stuff.  The first tricky area is dealing with the NSCalendar.  We just use the NSCalendar object to break up the date into components.  <strong>Note</strong>: This demo does not require that we break the date up into components.  You could have just as easily fed the date from the date picker into the notification fireDate.  The reason that I&#8217;m showing you how to break it down is, you may have some sort of custom date logic to work with and this makes things much easier in the future.</p>
<p>Another important bit of code is where we set the alertBody or the notification.  In this example we set it to the text that the user entered into the text field.  You can set this to whatever you like.</p>
<p>The other thing I want to mention is the infoDict in the code.  This dictionary is your chance to associate some additional information with the alert.  For example, if you are using this alert in a game like We Rule to notify you when a crop is ready.  You might want to set a key and value that contains the id of the crop that has completed.  For now, we just set some arbitrary values and you can ignore them if you like.</p>
<p>After actually scheduling the notification, we just reload the tableview to get it to display immediately.</p>
<h2>5. Handling Notifications After They Fire</h2>
<p>The last piece of this puzzle is determining what to do when a notification fires.  Fortunately, this step is very easy and handled inside of the appDelegate.  When a notification fires, there are one of two situations. 1. The app is running and 2. The app is not running (or running in the &#8220;background&#8221;) .</p>
<p>Open up your app delegate .m file and add the following code.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">BOOL</span><span style="color: #002200;">&#41;</span>application<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UIApplication <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>application didFinishLaunchingWithOptions<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSDictionary</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>launchOptions <span style="color: #002200;">&#123;</span>    
&nbsp;
    <span style="color: #11740a; font-style: italic;">// Override point for customization after application launch.</span>
&nbsp;
    <span style="color: #11740a; font-style: italic;">// Add the view controller's view to the window and display.</span>
    <span style="color: #002200;">&#91;</span>window addSubview<span style="color: #002200;">:</span>viewController.view<span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#91;</span>window makeKeyAndVisible<span style="color: #002200;">&#93;</span>;
&nbsp;
    application.applicationIconBadgeNumber <span style="color: #002200;">=</span> <span style="color: #2400d9;">0</span>;
&nbsp;
    <span style="color: #11740a; font-style: italic;">// Handle launching from a notification</span>
    UILocalNotification <span style="color: #002200;">*</span>localNotif <span style="color: #002200;">=</span>
    <span style="color: #002200;">&#91;</span>launchOptions objectForKey<span style="color: #002200;">:</span>UIApplicationLaunchOptionsLocalNotificationKey<span style="color: #002200;">&#93;</span>;
    <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>localNotif<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
        NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Recieved Notification %@&quot;</span>,localNotif<span style="color: #002200;">&#41;</span>;
    <span style="color: #002200;">&#125;</span>
&nbsp;
    <span style="color: #a61390;">return</span> <span style="color: #a61390;">YES</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>application<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UIApplication <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>app didReceiveLocalNotification<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UILocalNotification <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>notif <span style="color: #002200;">&#123;</span>
    <span style="color: #11740a; font-style: italic;">// Handle the notificaton when the app is running</span>
    NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Recieved Notification %@&quot;</span>,notif<span style="color: #002200;">&#41;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>The first thing we see here is the application badge number is getting set to 0.  Whenever a notification fires, it will increase the badge count on the application.  Next, we handle the case when the application launches from a notification.   This happens when the user presses the view button on the notification.  For now, we just NSLog the data, but you should handle the notification how you see fit for your app.</p>
<p>Finally, we implement the didReceiveLocalNotification method.  This method is required if you want to handle notifications at all in your app.  You will see this method fire when the app is running and you receive a local notification.  When the app is running, you will not see the UIAlertView show up with the notification data.</p>
<p>And there you have it!  The complete lifecycle of a local notification.  You may download the source for this tutorial below.  If you have any questions, feel free to post them in the comments section or <a href="http://twitter.com/brandontreb">write them to me on Twitter</a>.</p>
<p><a href="http://icodeblog.com/wp-content/uploads/2010/07/Notifier.zip">Notifier Source Code</a></p>
<p style="text-align: left;">
]]></content:encoded>
			<wfw:commentRss>http://icodeblog.com/2010/07/29/iphone-programming-tutorial-local-notifications/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
		<item>
		<title>Jailbreaking, iAds, T-Mobile and You</title>
		<link>http://icodeblog.com/2010/07/26/jailbreaking-iads-t-mobile-and-you/</link>
		<comments>http://icodeblog.com/2010/07/26/jailbreaking-iads-t-mobile-and-you/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 19:53:01 +0000</pubDate>
		<dc:creator>wolfgang</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[iPhone Articles]]></category>

		<guid isPermaLink="false">http://icodeblog.com/?p=2160</guid>
		<description><![CDATA[<a href="http://icodeblog.com/2010/07/26/jailbreaking-iads-t-mobile-and-you/"><img align="left" hspace="5" width="150" height="150" src="http://icodeblog.com/wp-content/uploads/2010/07/iphonebreak-150x150.jpg" class="alignleft tfe wp-post-image" alt="iphonebreak" title="iphonebreak" /></a>It may be a bit tough to keep track with Apple today, even at the accelerated pace we are used to. However, there have been a few interesting bits of information that we think you should be aware of and that surely impact your apps today and in the future. T-Mobile may be announcing its iPhone this week, iAds may be the income source you should be relying on and then there is the fact the U.S. law has now legalized the jailbreaking of smartphones under certain circumstances.]]></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%2Ficodeblog.com%2F2010%2F07%2F26%2Fjailbreaking-iads-t-mobile-and-you%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ficodeblog.com%2F2010%2F07%2F26%2Fjailbreaking-iads-t-mobile-and-you%2F&amp;source=elctech&amp;style=normal&amp;hashtags=iPhone+Articles" height="61" width="50" /><br />
			</a>
		</div>
<p>It may be a bit tough to keep track with Apple today, even at the accelerated pace we are used to. However, there have been a few interesting bits of information that we think you should be aware of and that surely impact your apps today and in the future. T-Mobile may be announcing its iPhone this week, iAds may be the income source you should be relying on and then there is the fact the U.S. law has now legalized the jailbreaking of smartphones under certain circumstances.</p>
<p>The new T-Mobile rumor comes via <a href="http://www.pocket-lint.com/news/34540/iphone4-hits-tmobile-july-30">Pocket-lint</a>. Again, a reliable source disclosed that the T-Mobile iPhone will be a reality on July 30. Why July 30? Because that is the day Apple plans to expand the iPhone 4’s availability to 17 more countries and T-Mobile may just fit into that announcement. There was no information on pricing.</p>
<p><a href="http://www.copyright.gov/1201/">A change to the DMCA in the U.S. Code</a> could get you thinking today. There are six scenarios in which consumers are now explicitly allowed to circumvent access controls to digital content, which is generally interpreted as the government’s ok to jailbreaking your iPhone and “liberating” other phones as well. Our conclusion is that the new addition basically opens the door to jailbreaking has many implications that may affect you even if you ignore this new law and stay with Apple’s guidelines.</p>
<p>Circumventing jailbreak blockers is now legally permitted through <em>“Computer programs that enable wireless telephone handsets to execute software applications, where circumvention is accomplished for the sole purpose of enabling interoperability of such applications, when they have been lawfully obtained, with computer programs on the telephone handset.”</em><em></em></p>
<p>As in so many cases, this new law can be interpreted and most certainly will be bent left and right. It is important to see that jailbreaking is only legal if a user tries to run an application that is otherwise blocked – unauthorized apps that are not sold through the App Store. Breaking the software to run the phone on another network is not covered per se. That indicates that Apple will not change its warranty guidelines and they warranty will be void if jailbreaking occurs.</p>
<p>The law does not require Apple to explicitly allow jailbreaking and remove jailbreaking hurdles. Apple simply has to tolerate the ongoing jailbreaking sport and consumers who actually jailbreak their devices to run unauthorized devices. The code change makes it lawful to circumvent any controls that are designed to block jailbreaking. That’s it.</p>
<p>Apple’s major concern of such a law is that potentially unsafe applications can now be run on iPhones and affect other applications as well. The tight control Apple has over the app environment is somewhat impaired and developers will have to recognize that potentially malicious applications can affect all other applications on an iPhone as well. Protecting your app may be evolving as a new topic we should be thinking about more seriously.</p>
<p>On the other side, outside sales open new opportunities for those who believe it is economically beneficial to sell apps through other channels than the App Store. However, several sources have raised the general earnings potential through app stores anyway and other income sources may be something you really should be thinking about. <a href="http://blogs.forrester.com/thomas_husson/10-07-26-future_application_stores">Forrester analyst Thomas Husson wrote</a> earlier today that Apple has made just $429 million in revenue from the App Store so far and that the bottom line isn’t exactly significant to Apple. Husson says that it is likely that “a significant number of independent developers have not recouped their investments via the current revenue-sharing model. “ Also, Husson says that there may be very limited interest from consumers to pay for apps.</p>
<p>The analyst believes that App Stores (other than Apple) will have to change to make their service more beneficial to all participants. He said that stores need to be more explicit about the addressable audience, create a viable business model for third parties, provide marketing and merchandising tools, offer a wide choice of payment and pricing options, show a local content catalog and look at other sources of inspiration – and not just Apple. So, if Apple is not the entire solution, there may be an opportunity now for other stores that carry “unauthorized” apps. If they are able to address current shortcomings, we may just see a new generation of App Stores developing in the very near future. </p>
]]></content:encoded>
			<wfw:commentRss>http://icodeblog.com/2010/07/26/jailbreaking-iads-t-mobile-and-you/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>It Just Won’t Go Away: iPhone Coming To T-Mobile?</title>
		<link>http://icodeblog.com/2010/07/22/it-just-won%e2%80%99t-go-away-iphone-coming-to-t-mobile/</link>
		<comments>http://icodeblog.com/2010/07/22/it-just-won%e2%80%99t-go-away-iphone-coming-to-t-mobile/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 01:34:30 +0000</pubDate>
		<dc:creator>wolfgang</dc:creator>
				<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://icodeblog.com/?p=2158</guid>
		<description><![CDATA[<a href="http://icodeblog.com/2010/07/22/it-just-won%e2%80%99t-go-away-iphone-coming-to-t-mobile/"><img align="left" hspace="5" width="150" height="150" src="http://icodeblog.com/wp-content/uploads/2010/06/iphoneicode-150x150.jpg" class="alignleft tfe wp-post-image" alt="iphoneicode" title="iphoneicode" /></a>I believe the last time I heard this one was in March of this year. Back then, it was the Financial Times that said that T-Mobile might start selling the iPhone later this year or next year. Now it is Cult of Mac, which quotes a “highly paces source within T-Mobile” that there is an 80% chance that T-Mobile might start selling the iPhone in the third quarter of this year. We leave this one up to you to decide what 80% really means.]]></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%2Ficodeblog.com%2F2010%2F07%2F22%2Fit-just-won%25e2%2580%2599t-go-away-iphone-coming-to-t-mobile%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ficodeblog.com%2F2010%2F07%2F22%2Fit-just-won%25e2%2580%2599t-go-away-iphone-coming-to-t-mobile%2F&amp;source=elctech&amp;style=normal&amp;hashtags=iphone" height="61" width="50" /><br />
			</a>
		</div>
<div>
<p>I believe the last time I heard this one was in March of this year. Back then, it was the Financial Times that said that T-Mobile might start selling the iPhone later this year or next year. Now it is Cult of Mac, which quotes a “highly paces source within T-Mobile” that there is an 80% chance that T-Mobile might start selling the iPhone in the third quarter of this year. We leave this one up to you to decide what 80% really means.</p>
<p>Apple’s relationship with AT&amp;T has been discussed so many times over the past week alone and it is clear that AT&amp;T has reached its limits where it can take Apple. And it appears that Apple thinks that AT&amp;T could use some competition to get its act together in some areas, such as data services and especially the limitations AT&amp;T has created.</p>
<p>It is more than likely that a competitor would be willing to open up its network a bit further in exchange to get a portion of the iPhone pie. T-Mobile is the smallest of the big 4 carriers in the U.S. with just under 34 million subscribers and its network quality isn’t the best. But it would help getting the phone to more customers. It might take some time until Verizon will get an iPhone as Apple is reportedly designing a CDMA iPhone from the ground up to accommodate a different chip set.</p>
<p><a href="http://www.cultofmac.com/iphone-is-coming-to-t-mobile-usa-in-q3-exclusive/39870">From Cult of Mac:</a></p>
<p><em>“Talks between Apple and T-Mobile are at an advanced stage, our source says, and it’s 80 percent likely that the iPhone will be coming to T-Mobile in Q3. The source works at T-Mobile but asked not to be quoted directly and to remain anonymous because they aren’t authorized to talk to the press. T-Mobile’s parent company, Deutsche Telekom, which carries the iPhone in Germany, was able to influence, the source said. T-Mobile USA is the fourth-largest U.S. carrier with </em><a href="http://en.wikipedia.org/wiki/T-Mobile_USA"><em>33.7 million customers</em></a><em>. Apple’s exclusive contract with AT&amp;T is reportedly ending this year, and many expect Apple to offer the iPhone to other wireless companies. Overseas, Apple has routinely added extra carriers when exclusivity deals in those markets expire.”</em></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://icodeblog.com/2010/07/22/it-just-won%e2%80%99t-go-away-iphone-coming-to-t-mobile/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>iPad: Ground Zero For Enhanced EBooks?</title>
		<link>http://icodeblog.com/2010/07/21/ipad-ground-zero-for-enhanced-ebooks/</link>
		<comments>http://icodeblog.com/2010/07/21/ipad-ground-zero-for-enhanced-ebooks/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 02:32:26 +0000</pubDate>
		<dc:creator>wolfgang</dc:creator>
				<category><![CDATA[ipad]]></category>

		<guid isPermaLink="false">http://icodeblog.com/?p=2156</guid>
		<description><![CDATA[<a href="http://icodeblog.com/2010/07/21/ipad-ground-zero-for-enhanced-ebooks/"><img align="left" hspace="5" width="150" height="150" src="http://icodeblog.com/wp-content/uploads/2010/07/ipad-150x150.jpg" class="alignleft tfe wp-post-image" alt="ipad" title="ipad" /></a>So we know that the iPad is often criticized as a device that tries to be everything to everyone, but does not excel at any particular discipline. Amazon’s Kindle comes up as an example very often, in which the Kindle is described as the better specialized ebook reader as it has the better screen for reading and better battery life. However, we are also seeing first signs of a new development in ebooks where ebooks turn into multimedia apps that simply can’t run on a Kindle.]]></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%2Ficodeblog.com%2F2010%2F07%2F21%2Fipad-ground-zero-for-enhanced-ebooks%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ficodeblog.com%2F2010%2F07%2F21%2Fipad-ground-zero-for-enhanced-ebooks%2F&amp;source=elctech&amp;style=normal&amp;hashtags=ipad" height="61" width="50" /><br />
			</a>
		</div>
<p>So we know that the iPad is often criticized as a device that tries to be everything to everyone, but does not excel at any particular discipline. Amazon’s Kindle comes up as an example very often, in which the Kindle is described as the better specialized ebook reader as it has the better screen for reading and better battery life. However, we are also seeing first signs of a new development in ebooks where ebooks turn into multimedia apps that simply can’t run on a Kindle.</p>
<p>Michael Wolf has recently <a href="http://pro.gigaom.com/2010/07/ipad-pushes-big-authors-into-enhanced-e-books?utm_source=gigaom&amp;utm_medium=editorial&amp;utm_term=offer&amp;utm_content=michaelwolf&amp;utm_campaign=crosspost">written </a>a great article on this topic for GigaOm Pro (subscription required), and sheds light on what he calls enhanced ebooks. Wolf believes that enhanced ebooks are just developing with all the disadvantages that come along with such a trend – such as inconsistent apps for different platforms, but it is easy to see that, if he is right, that the iPad may be much better positioned for media-rich ebooks than the Amazon Kindle.</p>
<p>That trend has lots of implications for developers, which may suddenly be able to go into a business that was previously reserved for printing services, but offer new types of applications that, for example, create ebook platforms and allow content creators to easily publish media rich magazines, newsletters or ebooks. The market opportunity is substantial, as Amazon announced this week that it is now selling more ebooks than hardcover versions.</p>
<p>Wolf believes that enhanced ebooks may result “in a whole new digital book industry, much like has been seen in the digital video and music industries.” He sees the iPad as a key platform as this trend and consumer perception will evolve. “The media-consumption friendliness of the iPad is a natural choice for authors looking to create a multimedia-laden e-book,” he wrote. </p>
]]></content:encoded>
			<wfw:commentRss>http://icodeblog.com/2010/07/21/ipad-ground-zero-for-enhanced-ebooks/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>iPad Sales Estimate Jumps 81%</title>
		<link>http://icodeblog.com/2010/07/20/ipad-sales-estimate-jumps-81/</link>
		<comments>http://icodeblog.com/2010/07/20/ipad-sales-estimate-jumps-81/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 20:56:15 +0000</pubDate>
		<dc:creator>wolfgang</dc:creator>
				<category><![CDATA[ipad]]></category>

		<guid isPermaLink="false">http://icodeblog.com/?p=2153</guid>
		<description><![CDATA[<a href="http://icodeblog.com/2010/07/20/ipad-sales-estimate-jumps-81/"><img align="left" hspace="5" width="150" height="150" src="http://icodeblog.com/wp-content/uploads/2010/06/ipad-150x150.jpg" class="alignleft tfe wp-post-image" alt="ipad" title="ipad" /></a>Apple will begin selling the iPad in 9 more countries on Friday. Austria, Belgium, Hong Kong, Ireland, Luxembourg, Mexico, Netherlands, New Zealand and Singapore will be added to the existing base, as Apple has been able to ramp its production to support new geographies.]]></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%2Ficodeblog.com%2F2010%2F07%2F20%2Fipad-sales-estimate-jumps-81%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ficodeblog.com%2F2010%2F07%2F20%2Fipad-sales-estimate-jumps-81%2F&amp;source=elctech&amp;style=normal&amp;hashtags=ipad" height="61" width="50" /><br />
			</a>
		</div>
<p>Apple will begin selling the iPad in 9 more countries on Friday. Austria, Belgium, Hong Kong, Ireland, Luxembourg, Mexico, Netherlands, New Zealand and Singapore will be added to the existing base, as Apple has been able to ramp its production to support new geographies.</p>
<p>However, “support” is somewhat relative as market researchers and analysts believe that Apple can still not meet actual demand and that iPad sales are limited by production capacity and not demand. iSuppli today raised its unit forecast by 81% to 12.9 million units for 2010. Next year, Apple may sell 36.5 million iPads and in 2012 50.6 million. If iSuppli is correct than Apple may sell 100 million iPads in less than three years, which makes it an interesting app platform, perhaps even more interesting than the iPhone for some.</p>
<p>“The iPad is shaping up to be the ‘Tickle Me Elmo’ of the 2010 holiday season, with product demand expected to vastly exceed available supply,” said Rhoda Alexander, director of monitor research for iSuppli.</p>
<p>For 2010, Apple is estimated to hold an 84% market share in tablet PCs and continue to dominate the segment at least until 2012. Competition may be insignificant until 2011 when other players, including HP, will have some products to show. iSuppli believes that Apple cannot sit back and just enjoy the success, but actually think about product improvements for next year. Likely additional changes will embrace an internal camera and expansion of the product line, potentially including additional screen sizes, the company said.</p>
<p>Apple rivals, on the other side, will have to focus less on the hardware but relate more to the suite of applications that can be paired with the hardware.</p>
<p>I may be speculating here, but I feel that this was not the last adjusted iPad forecast for the year. </p>
]]></content:encoded>
			<wfw:commentRss>http://icodeblog.com/2010/07/20/ipad-sales-estimate-jumps-81/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Antenna Confusion Not Deterring New Users</title>
		<link>http://icodeblog.com/2010/07/19/antenna-confusion-not-deterring-new-users/</link>
		<comments>http://icodeblog.com/2010/07/19/antenna-confusion-not-deterring-new-users/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 17:11:48 +0000</pubDate>
		<dc:creator>wolfgang</dc:creator>
				<category><![CDATA[iphone]]></category>
		<category><![CDATA[iphone 4]]></category>

		<guid isPermaLink="false">http://icodeblog.com/?p=2149</guid>
		<description><![CDATA[<a href="http://icodeblog.com/2010/07/19/antenna-confusion-not-deterring-new-users/"><img align="left" hspace="5" width="150" height="150" src="http://icodeblog.com/wp-content/uploads/2010/07/applelogo1-150x150.jpg" class="alignleft tfe wp-post-image" alt="applelogo" title="applelogo" /></a>With all the hoopla surrounding the iPhone antenna issues, it’s easy to imagine that Apple may be losing some buyers to Android. There is enough confusion out there to suggest that a different smartphone may be a better smartphone right no]]></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%2Ficodeblog.com%2F2010%2F07%2F19%2Fantenna-confusion-not-deterring-new-users%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ficodeblog.com%2F2010%2F07%2F19%2Fantenna-confusion-not-deterring-new-users%2F&amp;source=elctech&amp;style=normal&amp;hashtags=iphone+4" height="61" width="50" /><br />
			</a>
		</div>
<p>With all the hoopla surrounding the iPhone antenna issues, it’s easy to imagine that Apple may be losing some buyers to Android. There is enough confusion out there to suggest that a different smartphone may be a better smartphone right now.</p>
<p>However, the antenna issue has not really big impact on prospective buyers that are new to Apple, but it may have an impact on iPhone upgrades, which should make you think twice about iOS 4. IDC has published brief results of a survey that asked people whether they are still interested in buying an iPhone 4. 74% of those who wanted to buy an iPhone before have not changed their mind. However, 66% of those who own an iPhone already said they are delaying an upgrade to the iPhone 4. IDC did not break out numbers of those iPhone owners and which iPhones they own.</p>
<p>Of course, those numbers are to be taken with a grain of salt as purchase intentions do not really relate to actual behavior and intentions can change in an instant. However, the numbers may reflect the current mood in the market, which we would describe as cautious. IDC noted that the actual impact of the antenna issues and the effect of Apple’s response to give out free bumpers will only reveal itself over the next few months. That said, Steve Jobs said that more than 3 million iPhones have been sold already. </p>
]]></content:encoded>
			<wfw:commentRss>http://icodeblog.com/2010/07/19/antenna-confusion-not-deterring-new-users/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Behind The Scenes of The Apple-AT&amp;T Relationship</title>
		<link>http://icodeblog.com/2010/07/19/behind-the-scenes-of-the-apple-att-relationship/</link>
		<comments>http://icodeblog.com/2010/07/19/behind-the-scenes-of-the-apple-att-relationship/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 16:46:11 +0000</pubDate>
		<dc:creator>wolfgang</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[AT&T]]></category>

		<guid isPermaLink="false">http://icodeblog.com/?p=2144</guid>
		<description><![CDATA[<a href="http://icodeblog.com/2010/07/19/behind-the-scenes-of-the-apple-att-relationship/"><img align="left" hspace="5" width="150" height="150" src="http://icodeblog.com/wp-content/uploads/2010/07/applelogo-150x150.jpg" class="alignleft tfe wp-post-image" alt="applelogo" title="applelogo" /></a>Wired will be running an article in its upcoming August issue that will shed some light on the rather difficult relationship between Apple and AT&#038;T. While it is always difficult to determine how accurate such reports are, the article promises to provide background information why AT&#038;T seems to be falling of what the iPhone really would need.]]></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%2Ficodeblog.com%2F2010%2F07%2F19%2Fbehind-the-scenes-of-the-apple-att-relationship%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ficodeblog.com%2F2010%2F07%2F19%2Fbehind-the-scenes-of-the-apple-att-relationship%2F&amp;source=elctech&amp;style=normal&amp;hashtags=apple,AT%26amp%3BT,iphone" height="61" width="50" /><br />
			</a>
		</div>
<p>Wired will be running an article in its upcoming August issue that will shed some light on the rather difficult relationship between Apple and AT&amp;T. While it is always difficult to determine how accurate such reports are, the article promises to provide background information why AT&amp;T seems to be falling of what the iPhone really would need.</p>
<p>Apparently, Apple is not as happy with AT&amp;T as it is publicly stated by the company. According to the article Jobs considered dropping AT&amp;T “more than a dozen times”. It isn’t difficult to figure out what the differences between the two companies really are – it comes down to data capability and affordability. For example, Apple wanted tethering to be included in the data plan, AT&amp;T wanted extra money – which makes sense, as AT&amp;T’s cellular network has been brought down to its knees due heavy data usage and extra charges would create a barrier for additional data use (and deliver extra revenue, of course.)</p>
<p>We can only imagine how much the two are arguing over Facetime and its availability on the 3G network.</p>
<p>There is also some information on the never ending rumors of a Verizon iPhone. The article states that Apple considered switching to Verizon several times, but concluded that the different chip sizes and the tight iPhone design would require Apple to create a CDMA iPhone from the ground up. The <a href="http://www.zdnet.com/blog/apple/wired-on-the-iphone-network-meltdown/7640">article isn’t out yet</a>, but it is worth the read when published.<strong></strong> </p>
]]></content:encoded>
			<wfw:commentRss>http://icodeblog.com/2010/07/19/behind-the-scenes-of-the-apple-att-relationship/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>iPhone Predicted To See Huge Surge in Demand</title>
		<link>http://icodeblog.com/2010/07/15/iphone-predicted-to-see-huge-surge-in-demand/</link>
		<comments>http://icodeblog.com/2010/07/15/iphone-predicted-to-see-huge-surge-in-demand/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 14:22:43 +0000</pubDate>
		<dc:creator>wolfgang</dc:creator>
				<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://icodeblog.com/?p=2142</guid>
		<description><![CDATA[<a href="http://icodeblog.com/2010/07/15/iphone-predicted-to-see-huge-surge-in-demand/"><img align="left" hspace="5" width="150" height="150" src="http://icodeblog.com/wp-content/uploads/2010/07/iphone4-150x150.jpg" class="alignleft tfe wp-post-image" alt="iphone4" title="iphone4" /></a>ChangeWave has released interesting survey findings that indicate sharply rising demand for Apple’s iPhone over the next quarter.  The result contradicts some expectations that Apple may be gambling away its customer trust by ignoring the iPhone reception issues, but then [...]]]></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%2Ficodeblog.com%2F2010%2F07%2F15%2Fiphone-predicted-to-see-huge-surge-in-demand%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ficodeblog.com%2F2010%2F07%2F15%2Fiphone-predicted-to-see-huge-surge-in-demand%2F&amp;source=elctech&amp;style=normal&amp;hashtags=iphone" height="61" width="50" /><br />
			</a>
		</div>
<p>ChangeWave has <a href="http://www.changewaveresearch.com/articles/2010/07/smart_phones_20100714.html">released </a>interesting survey findings that indicate sharply rising demand for Apple’s iPhone over the next quarter.  The result contradicts some expectations that Apple may be gambling away its customer trust by ignoring the iPhone reception issues, but then we do know that the company may be addressing some questions in an upcoming <a href="http://www.appleinsider.com/articles/10/07/14/apple_to_hold_iphone_4_press_conference_on_friday.html">press conference</a> and an iOS <a href="http://www.macobserver.com/tmo/article/ios_4.0.1_update_could_ship_thursday/">update</a>.</p>
<p>The survey concluded that the iPhone leaves its users far more satisfied than any other phone: RIM with 30%. Especially Blackberrys seem to have lost their cool factor and Research in Motion has to think about ways to regain traction. The same goes for Motorola, which has lost consumer interest over the past quarter. Onbly 6% (down from  14%) of smartphone buyers are looking into a Blackberry and only 9% (down from16%)  into a Motorola device. Interest in the iPhone has jumped from 31% to 52%, while HTC’s Android devices have also shown more traction: 19% of respondents said they were looking into an Android HTC phones (up from 12%).</p>
<p>According to ChangeWave, “the momentum for Apple and HTC is occurring at the expense of other smart phone manufacturers – Motorola and Research in Motion in particular. […] The market situation for RIM appears far more problematic, at least short term. RIM&#8217;s customer satisfaction ratings have plummeted for the past 7 quarters, and planned buying among consumers is at the lowest levels ever recorded for RIM in a ChangeWave survey.” </p>
]]></content:encoded>
			<wfw:commentRss>http://icodeblog.com/2010/07/15/iphone-predicted-to-see-huge-surge-in-demand/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>BMW First To Integrate iPod Out</title>
		<link>http://icodeblog.com/2010/07/13/bmw-first-to-integrate-ipod-out/</link>
		<comments>http://icodeblog.com/2010/07/13/bmw-first-to-integrate-ipod-out/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 03:42:21 +0000</pubDate>
		<dc:creator>wolfgang</dc:creator>
				<category><![CDATA[iphone]]></category>
		<category><![CDATA[iOS4]]></category>

		<guid isPermaLink="false">http://icodeblog.com/?p=2138</guid>
		<description><![CDATA[<a href="http://icodeblog.com/2010/07/13/bmw-first-to-integrate-ipod-out/"><img align="left" hspace="5" width="150" height="150" src="http://icodeblog.com/wp-content/uploads/2010/06/ios4-150x150.jpg" class="alignleft tfe wp-post-image" alt="ios4" title="ios4" /></a>BMW has been pretty quick to take advantage of iOS 4 and enable the new iPod Out new feature that was first described in April when developers noted an extended &#8220;iPod Accessory Protocol&#8221;. BMW said it is using the software [...]]]></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%2Ficodeblog.com%2F2010%2F07%2F13%2Fbmw-first-to-integrate-ipod-out%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ficodeblog.com%2F2010%2F07%2F13%2Fbmw-first-to-integrate-ipod-out%2F&amp;source=elctech&amp;style=normal&amp;hashtags=iOS4" height="61" width="50" /><br />
			</a>
		</div>
<p>BMW has been pretty quick to take advantage of iOS 4 and enable the new iPod Out new feature that was first described in April when developers noted an extended &#8220;iPod Accessory Protocol&#8221;.</p>
<p>BMW said it is using the software update to generate an iPod-like menu on the center dash display of BMWs and Minis. Users can control the playback of media from the car&#8217;s own controls rather than using a touchscreen. The update also integrates new in-car features such as custom playlists as well as Genius playlists.</p>
<p>There was no information which cars will be offering the new feature and when it could be available. BMW simply says that the feature will be coming to future cars. However, iPod Out will be a key feature of the Mini Connected system, which is expected to make its debut in next year.</p>
<p>A range of BMW models are due for a refresh. The new 3 series, 6 series and the refresh of the 7 series are more than likely to offer iPod Out right away. </p>
]]></content:encoded>
			<wfw:commentRss>http://icodeblog.com/2010/07/13/bmw-first-to-integrate-ipod-out/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>What Exactly Is The iPad?</title>
		<link>http://icodeblog.com/2010/07/12/what-exactly-is-the-ipad/</link>
		<comments>http://icodeblog.com/2010/07/12/what-exactly-is-the-ipad/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 07:13:42 +0000</pubDate>
		<dc:creator>wolfgang</dc:creator>
				<category><![CDATA[ipad]]></category>

		<guid isPermaLink="false">http://icodeblog.com/?p=2133</guid>
		<description><![CDATA[<a href="http://icodeblog.com/2010/07/12/what-exactly-is-the-ipad/"><img align="left" hspace="5" width="150" height="150" src="http://icodeblog.com/wp-content/uploads/2010/07/ipad-150x150.jpg" class="alignleft tfe wp-post-image" alt="ipad" title="ipad" /></a>That may sound like a rather silly question and you may answer that it is a tablet, of course. But, if you think about it, the iPad can be many things to many people, depending on why it is purposed. And given the fact that Apple needs to carve out a market for it, it is likely that many buyers are using the iPad to replace something else. And that is the core of the question: What is the iPad – and what is it to most people? If you know the answer, you may have a good idea what apps you should be developing to target iPad users.]]></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%2Ficodeblog.com%2F2010%2F07%2F12%2Fwhat-exactly-is-the-ipad%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ficodeblog.com%2F2010%2F07%2F12%2Fwhat-exactly-is-the-ipad%2F&amp;source=elctech&amp;style=normal&amp;hashtags=ipad" height="61" width="50" /><br />
			</a>
		</div>
<p>That may sound like a rather silly question and you may answer that it is a tablet, of course. But, if you think about it, the iPad can be many things to many people, depending on why it is purposed. And given the fact that Apple needs to carve out a market for it, it is likely that many buyers are using the iPad to replace something else. And that is the core of the question: What is the iPad – and what is it to most people? If you know the answer, you may have a good idea what apps you should be developing to target iPad users.</p>
<p>So take a guess: Is it the Internet browsing device that was demonstrated by Steve Jobs? Or is it a gaming device?</p>
<p>It turns out that a market research firm, <a href="http://www.resolvemr.com/">Resolve</a>, has looked at exactly that question and has come up with some interesting numbers.</p>
<p>49% of people in the survey, and owners of an iPad, said that, because of the iPad, they would not buy an e-reader as a result. 38% said they would not buy another portable gaming device and 32% said they would not buy a netbook as a result. Conceivably, most people see in the iPad a great e-reader and portable gaming device. However, 60% said that the best mobile gaming device would be a “portable gaming device” and only 23% pointed to the iPad. 8% mentioned that a smartphone offers the most enjoyable mobile gaming experience. The implication seems to be clear: Despite the fact that Amazon’s Kindle is generally considered to be the better e-reader, the iPad is invading its turf and the Kindle may need to drop further in price.</p>
<p>Resolve also looked into the purchase decisions – and what made people buy the iPad. 56% of buyers are looking for entertainment and 42% simply think the iPad is “cool”. The iPad is generally see as an “expensive toy” and a “breakthrough technology” device. Reasons for not buying the iPad currently include its price and the fact that people simply do not know what to do with it. 37% of iPad buyers do not own any other Apple products, Resolve said. 49% own an iPod, 24% an iPhone and 16% a Macbook.</p>
<p>Books and games appear to be the biggest opportunities on the iPad, if Resolve is correct. </p>
]]></content:encoded>
			<wfw:commentRss>http://icodeblog.com/2010/07/12/what-exactly-is-the-ipad/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Apple’s Huge iAd Payout</title>
		<link>http://icodeblog.com/2010/07/11/apple%e2%80%99s-huge-iad-payout/</link>
		<comments>http://icodeblog.com/2010/07/11/apple%e2%80%99s-huge-iad-payout/#comments</comments>
		<pubDate>Sun, 11 Jul 2010 08:31:23 +0000</pubDate>
		<dc:creator>wolfgang</dc:creator>
				<category><![CDATA[AppStore]]></category>
		<category><![CDATA[iAd]]></category>

		<guid isPermaLink="false">http://icodeblog.com/?p=2130</guid>
		<description><![CDATA[<a href="http://icodeblog.com/2010/07/11/apple%e2%80%99s-huge-iad-payout/"><img align="left" hspace="5" width="150" height="100" src="http://icodeblog.com/wp-content/uploads/2010/06/iad1-150x100.jpg" class="alignleft tfe wp-post-image" alt="iad" title="iad" /></a>So we have heard about Apple’s ginormous advertising deals for iAd, but it seems that Apple’s deals reach through to developers as well. One developer, Jason Ting, said that his LED flashlight app (LED Light for iPhone 4), which is [...]]]></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%2Ficodeblog.com%2F2010%2F07%2F11%2Fapple%25e2%2580%2599s-huge-iad-payout%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ficodeblog.com%2F2010%2F07%2F11%2Fapple%25e2%2580%2599s-huge-iad-payout%2F&amp;source=elctech&amp;style=normal&amp;hashtags=iAd" height="61" width="50" /><br />
			</a>
		</div>
<p>So we have heard about Apple’s ginormous advertising deals for iAd, but it seems that Apple’s deals reach through to developers as well. One developer, Jason Ting, said that his LED flashlight app (<a title="Permanent Link to LED Light for iPhone 4" href="http://www.jzlabs.com/2010/06/28/iphone-4-led-light/">LED Light for iPhone 4</a>), which is offered as an ad-supported free version, turned in $1372.20 of advertising revenue in one day.</p>
<p>That revenue was based on 9000 downloads, 9300 ad impressions and a click-through rate of 11.8%. The eCPM rate came in at close to $150, which is about 100 times higher than what other mobile deals currently pay. And if you compare the deal against standard eCPM models, Apple’s pay is up to 300 times higher. Of course, Ting appears to be an extreme example, as we have heard other reports with much lower eCPM rates as well. And Ting’s revenue still includes Apple’s 40% cut.</p>
<p>Another developer, <a href="http://kswizz.com/post/786160311/iad-report">Kenneth Ballenegger</a>, said that his eCPM was somewhere between $10 and $15. He also noted that iAd’s fill rate is at just 10% and the ad refresh rate is much lower than that of other ad networks and he, in fact, said that he expects iAd eCPM rates of just over $1 in the long run. In the end, the fill rate seems to be what is the biggest concern out there and it’s so low that, for many developers &#8211; those with extremely high ad views &#8211; it just does not replace Google yet. However, iAd just launched and like other networks it needs some time to ramp up. So let’s be patient.</p>
<p>We should be realistic about the eCPM rates. Of course, there’s a novelty to iAds and that certainly benefits developers right now. Eventually, the eCPM rate will fall, but we would expect the numbers to remain higher than on the desktop. You can run iAds and use other networks such as Google as a fallback option. </p>
]]></content:encoded>
			<wfw:commentRss>http://icodeblog.com/2010/07/11/apple%e2%80%99s-huge-iad-payout/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Asset Libraries and Blocks in iOS 4</title>
		<link>http://icodeblog.com/2010/07/08/asset-libraries-and-blocks-in-ios-4/</link>
		<comments>http://icodeblog.com/2010/07/08/asset-libraries-and-blocks-in-ios-4/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 20:29:31 +0000</pubDate>
		<dc:creator>Collin</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[iOS4]]></category>

		<guid isPermaLink="false">http://icodeblog.com/?p=2068</guid>
		<description><![CDATA[<a href="http://icodeblog.com/2010/07/08/asset-libraries-and-blocks-in-ios-4/"><img align="left" hspace="5" width="150" height="150" src="http://icodeblog.com/wp-content/uploads/2010/07/Screen-shot-2010-07-06-at-1.45.15-PM-150x150.png" class="alignleft tfe wp-post-image" alt="Screen shot 2010-07-06 at 1.45.15 PM" title="Screen shot 2010-07-06 at 1.45.15 PM" /></a>iOS 4 presented a million billion new API&#8217;s by Apple&#8217;s count, but for this post I am going to show a quick demo of the new Assets Library API where you can now get to users photos and videos with [...]]]></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%2Ficodeblog.com%2F2010%2F07%2F08%2Fasset-libraries-and-blocks-in-ios-4%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ficodeblog.com%2F2010%2F07%2F08%2Fasset-libraries-and-blocks-in-ios-4%2F&amp;source=elctech&amp;style=normal&amp;hashtags=iOS4" height="61" width="50" /><br />
			</a>
		</div>
<div>
<p>iOS 4 presented a million billion new API&#8217;s by Apple&#8217;s count, but for this post I am going to show a quick demo of the new Assets Library API where you can now get to users photos and videos with more access than ever before. This new API relies on the new programming device called Blocks that has been introduced with iOS 4. Blocks are used through many of the new API&#8217;s as a kind of extended @selector. We will look into this new development device and make a small project to create our own UIImagePickerController. In the end we are going to create a tableview that is filled with all the photos within our library. Check out the video below or follow the steps typed out below.</p>
<h2><span style="color: #ff6600;">Screencast</span></h2>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="600" height="375" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=13187660&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=ff9933&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="600" height="375" src="http://vimeo.com/moogaloop.swf?clip_id=13187660&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=ff9933&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><a href="http://vimeo.com/13187660">Using the Assets Library API in iOS 4</a> from <a href="http://vimeo.com/user2008025">Collin Ruffenach</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<h2><span style="color: #ff6600;">Creating the Project</span></h2>
<p>Create a new project in xCode. Make it for the iPhone since this is an iOS 4 framework. A view based application will create a view controller for us, so lets use that. Call your project MyImagePicker.</p>
<p style="text-align: center;"><a href="http://icodeblog.com/wp-content/uploads/2010/07/Make-Project1.png"><img class="size-full wp-image-2075 aligncenter" title="Make Project" src="http://icodeblog.com/wp-content/uploads/2010/07/Make-Project1.png" alt="" width="478" height="391" /></a></p>
<h2><span style="color: #ff6600;">Adding in the framework</span></h2>
<p>This project will revolve around taking advantage of the AssetsLibrary framework introduced with iOS 4. Due to this you must have the newest xCode and iPhone SDK installed with iOS 4.0 support. If this is done you should be able to expand the frameworks folder of your project. Right click on UIKit.framework and select &#8220;Reveal in Finder&#8221;. This will open up the folder that contains all of the frameworks you can use in an iOS 4 project. Find AssetsLibrary.framework and drag into the Frameworks folder of your project. Once dragged in make sure that the Copy items into destination folder options is deselected and that it is set to recursively create groups for any added folders.</p>
<p style="text-align: center;"><a href="http://icodeblog.com/wp-content/uploads/2010/07/Import-Options.png"><img class="size-full wp-image-2078 aligncenter" title="Import Options" src="http://icodeblog.com/wp-content/uploads/2010/07/Import-Options.png" alt="" width="416" height="388" /></a></p>
<h2><span style="color: #ff6600;">Using the framework with blocks</span></h2>
<p>iOS 4.0 introduces a totally new programming concept for Objective C developers to take advantage of when creating their own code and when using Apple&#8217;s API. Blocks in the most simple terms are Objective C objects that are methods. A block uses the special character ^ to denote its beginning and is a required parameter of many of the API&#8217;s introduced within iOS 4.0. Apple has some great documentation on blocks, and how they conceptually fit into the current objective C landscape. You can see their concise but effective overview <a title="Blocks: A short practical guide" href="http://developer.apple.com/iphone/library/featuredarticles/Short_Practical_Guide_Blocks/index.html" target="_blank">here</a>. For our purposes I am just going to review the simple syntax of a block.</p>
<p>Before we dive into blocks lets take a look at the AssetsLibrary framework methods that will require them. The general flow of the object access we will be doing is as follows.<br />
<a href="http://icodeblog.com/wp-content/uploads/2010/07/Screen-shot-2010-07-01-at-4.48.20-PM.png"></a></p>
<p style="text-align: center;"><a href="http://icodeblog.com/wp-content/uploads/2010/07/Screen-shot-2010-07-01-at-4.48.20-PM.png"><img class="size-full wp-image-2081 aligncenter" title="Screen shot 2010-07-01 at 4.48.20 PM" src="http://icodeblog.com/wp-content/uploads/2010/07/Screen-shot-2010-07-01-at-4.48.20-PM.png" alt="" width="395" height="615" /></a></p>
<p>We are going to create an ALAssetsLibrary and call a method on it that will enumerate through all the ALAssetsGroups it has access to. For every ALAssetsGroup we will call a method on it which will enumerate through the ALAssets it has access to. We will save each ALAsset into an array we will use to populate our tableview. The two different enumerations we are going to perform is where the blocks will come in. But lets first set up our view controller appropriately.</p>
<h2><span style="color: #ff6600;">MyImagePickerViewController.h</span></h2>
</div>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;">#import &amp;lt;UIKit/UIKit.h&amp;gt;;</span>
<span style="color: #6e371a;">#import &amp;lt;AssetsLibrary/AssetsLibrary.h&amp;gt;;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #a61390;">@interface</span> MyImagePickerViewController <span style="color: #002200;">:</span> UIViewController <span style="color: #002200;">&#123;</span>
&nbsp;
	IBOutlet UITableView <span style="color: #002200;">*</span>tableview;
	IBOutlet UIActivityIndicatorView <span style="color: #002200;">*</span>activity;
&nbsp;
	<span style="color: #400080;">NSMutableArray</span> <span style="color: #002200;">*</span>assets;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #a61390;">@property</span> <span style="color: #002200;">&#40;</span>nonatomic, retain<span style="color: #002200;">&#41;</span> IBOutlet UITableView <span style="color: #002200;">*</span>tableview;
<span style="color: #a61390;">@property</span> <span style="color: #002200;">&#40;</span>nonatomic, retain<span style="color: #002200;">&#41;</span> IBOutlet UIActivityIndicatorView <span style="color: #002200;">*</span>activity;
&nbsp;
<span style="color: #a61390;">@end</span></pre></div></div>

<p>We are going be using the assets array here to hold the assets that we are going to pull using the AssetsLibrary Framework.</p>
<p>Now open up MyImagePickerViewController.xib and drag in a UITableView and a UIActivityIndicatorView. With these in place connect them to the IBOutlets you created for this class. Also make sure to connect the UITableViewDataSource and UITableViewDelegate to the MyImagePickerViewController as well. With that done we can start to use the AssetsLibrary Framework.</p>
<h2><span style="color: #ff6600;">Using the Asset Library</span></h2>
<p><span style="color: #ff6600;"><span style="color: #000000;">Now we are going to use our AssetsLibrary framework. This will be done within the viewDidLoad method of your MyImagePickerViewController.m. Put the following code in there.</span></span></p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #2400d9;">1</span> <span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>viewDidLoad <span style="color: #002200;">&#123;</span>
<span style="color: #2400d9;">2</span>
<span style="color: #2400d9;">3</span>    <span style="color: #002200;">&#91;</span>super viewDidLoad<span style="color: #002200;">&#93;</span>;
<span style="color: #2400d9;">4</span>    <span style="color: #002200;">&#91;</span>activity startAnimating<span style="color: #002200;">&#93;</span>;
<span style="color: #2400d9;">5</span>
<span style="color: #2400d9;">6</span>    <span style="color: #a61390;">void</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">^</span>assetEnumerator<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">struct</span> ALAsset <span style="color: #002200;">*</span>, NSUInteger, <span style="color: #a61390;">BOOL</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">=</span> <span style="color: #002200;">^</span><span style="color: #002200;">&#40;</span>ALAsset <span style="color: #002200;">*</span>result, NSUInteger index, <span style="color: #a61390;">BOOL</span> <span style="color: #002200;">*</span>stop<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
<span style="color: #2400d9;">7</span>	<span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span>result <span style="color: #002200;">!=</span> <span style="color: #a61390;">NULL</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
<span style="color: #2400d9;">8</span>		NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;See Asset: %@&quot;</span>, result<span style="color: #002200;">&#41;</span>;
<span style="color: #2400d9;">9</span>		<span style="color: #002200;">&#91;</span>assets addObject<span style="color: #002200;">:</span>result<span style="color: #002200;">&#93;</span>;
<span style="color: #2400d9;">10</span>
<span style="color: #2400d9;">11</span>	<span style="color: #002200;">&#125;</span>
<span style="color: #2400d9;">12</span>    <span style="color: #002200;">&#125;</span>;
<span style="color: #2400d9;">13</span>
<span style="color: #2400d9;">14</span>    <span style="color: #a61390;">void</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">^</span>assetGroupEnumerator<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">struct</span> ALAssetsGroup <span style="color: #002200;">*</span>, <span style="color: #a61390;">BOOL</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">=</span>  <span style="color: #002200;">^</span><span style="color: #002200;">&#40;</span>ALAssetsGroup <span style="color: #002200;">*</span>group, <span style="color: #a61390;">BOOL</span> <span style="color: #002200;">*</span>stop<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
<span style="color: #2400d9;">15</span>	<span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span>group <span style="color: #002200;">!=</span> <span style="color: #a61390;">nil</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
<span style="color: #2400d9;">16</span>		<span style="color: #002200;">&#91;</span>group enumerateAssetsUsingBlock<span style="color: #002200;">:</span>assetEnumerator<span style="color: #002200;">&#93;</span>;
<span style="color: #2400d9;">17</span>	<span style="color: #002200;">&#125;</span>
<span style="color: #2400d9;">18</span>
<span style="color: #2400d9;">19</span>
<span style="color: #2400d9;">20</span>	<span style="color: #002200;">&#91;</span>self.tableView reloadData<span style="color: #002200;">&#93;</span>;
<span style="color: #2400d9;">21</span>	<span style="color: #002200;">&#91;</span>self.activity stopAnimating<span style="color: #002200;">&#93;</span>;
<span style="color: #2400d9;">22</span>	<span style="color: #002200;">&#91;</span>self.activity setHidden<span style="color: #002200;">:</span><span style="color: #a61390;">YES</span><span style="color: #002200;">&#93;</span>;
<span style="color: #2400d9;">23</span>    <span style="color: #002200;">&#125;</span>;
<span style="color: #2400d9;">24</span>
<span style="color: #2400d9;">25</span>    assets <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSMutableArray</span> alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;
<span style="color: #2400d9;">26</span>    library <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>ALAssetsLibrary alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;
<span style="color: #2400d9;">27</span>    <span style="color: #002200;">&#91;</span>library enumerateGroupsWithTypes<span style="color: #002200;">:</span>ALAssetsGroupAlbum
<span style="color: #2400d9;">28</span>					   usingBlock<span style="color: #002200;">:</span>assetGroupEnumerator
<span style="color: #2400d9;">29</span>					 failureBlock<span style="color: #002200;">:</span> <span style="color: #002200;">^</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSError</span> <span style="color: #002200;">*</span>error<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
<span style="color: #2400d9;">30</span>						 NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Failure&quot;</span><span style="color: #002200;">&#41;</span>;
<span style="color: #2400d9;">31</span>					 <span style="color: #002200;">&#125;</span><span style="color: #002200;">&#93;</span>;
<span style="color: #2400d9;">32</span> <span style="color: #002200;">&#125;</span></pre></div></div>

<p>We are going to be going though this code line by line. On line 4, we start animating our activity indicator. I will explain why we have to do that a little bit later. Lines 6 &#8211; 23 are the lines that will  declare the two blocks that we will use to fill our tableview with pictures. We are going to declare two blocks to use as parameters to methods within a ALAssetLibrary object and a ALAssetGroup object. The first method call we will make will be on our ALAssetLibrary object. So for the moment lets skip passed the block declarations and look at line 25. On line 25 we instantiate our NSMutableArray to hold the ALAssets that we will pull out from the AssetsLibrary. On line 26 we will create our ALAssetsLibrary object. We will call a single method on this object to loop through all of the assets in a library. The method is:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">– enumerateGroupsWithTypes<span style="color: #002200;">:</span>usingBlock<span style="color: #002200;">:</span>failureBlock<span style="color: #002200;">:</span></pre></div></div>

<p>This method takes in 3 parameters. An ALAssetGroup type, a block to be performed on each group and a block to be performed on failure. Lets talk about block syntax. A block is a native Objective C object. It is a subclass of NSObject. With that said it is also an Objective C method. An objective C method is composed of three things. A return type, a parameter list and a piece of code to be executed. We are going to pass the assetsGroupEnumerator block object that declare on line 14 into this method. Lets take a look at how the block is declared.</p>
<p style="text-align: center;"><a href="http://icodeblog.com/wp-content/uploads/2010/07/Screen-shot-2010-07-06-at-1.45.15-PM.png"><img class="size-full wp-image-2101 aligncenter" title="Screen shot 2010-07-06 at 1.45.15 PM" src="http://icodeblog.com/wp-content/uploads/2010/07/Screen-shot-2010-07-06-at-1.45.15-PM.png" alt="" width="582" height="124" /></a></p>
<p>You begin by specifying a return type for the block. Void in this case. Next you enclose a name for the block which is proceeded by a carrot ^ character. This is the special character Apple has decided on to denote blocks. You begin block names with blocks as well as the actual declaration of what a block is. This name is wrapped in parenthesis. This is followed by the parameter list that the block will accept. In this case it is a ALAssetsGroup object and a Boolean indicating whether to stop. Now I did not come up with these parameters by myself. Since I will be passing this block into an ASAssetLibrary the documentation will tell us what will be passed into the block. ALAssetsLibrary objects documentation can be seen <a title="ALAssetsLibrary API Reference" href="http://developer.apple.com/iphone/library/documentation/AssetsLibrary/Reference/ALAssetsLibrary_Class/Reference/Reference.html" target="_blank">here</a>. With that all said, lets take a look at the code that will actually compose this block. Starting on line 15 we will make sure that we are seeing a valid group. If the ALAssetsGroup object that we are passed is valid then we will call another enumeration on the group which will enumerate through assets. This enumeration method also requires a block. We declared this block above. This block is called assetEnumerator. Once again we retrieved the parameters list from the documentation of the object asking for, in this case an <a title="ALAssetsGroup API" href="http://developer.apple.com/iphone/library/documentation/AssetsLibrary/Reference/ALAssetsGroup_Class/Reference/Reference.html#//apple_ref/occ/instm/ALAssetsGroup/enumerateAssetsWithOptions:usingBlock:" target="_blank">ALAssetsGroup</a>.</p>
<p>For this block, which begins on line 6, the block is passed an ALAsset object, an index and a stopping condition boolean. Within the code of the block we will ensure that the returned ALAsset is valid and if it is we will add it to our array which will hold all of our assets. With this block declared we pass it into the call to our ALAssetsLibrary object on line 16.  Once every group has been enumerated and our array is filled with all of our ALAssets we will tell the tableview to reload its data and get rid of our UIActivityIndicatorView.</p>
<p>With all of this done all that remains if filling in the required UITableViewDataSource methods. The tableview will be filled with the assets we collected. ALAsset objects are cool in that they include a method called -thumbnail which returns a CGImageRef to a thumbnail we will use. I won&#8217;t explain the development of these methods any further since they are pretty straight forward.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">// Customize the number of sections in the table view.</span>
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>NSInteger<span style="color: #002200;">&#41;</span>numberOfSectionsInTableView<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UITableView <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>tableView <span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">return</span> <span style="color: #2400d9;">1</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #11740a; font-style: italic;">// Customize the number of rows in the table view.</span>
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>NSInteger<span style="color: #002200;">&#41;</span>tableView<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UITableView <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>tableView numberOfRowsInSection<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>NSInteger<span style="color: #002200;">&#41;</span>section <span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">return</span> <span style="color: #002200;">&#91;</span>assets count<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #11740a; font-style: italic;">// Customize the appearance of table view cells.</span>
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>UITableViewCell <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>tableView<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UITableView <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>tableView cellForRowAtIndexPath<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSIndexPath</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>indexPath <span style="color: #002200;">&#123;</span>
&nbsp;
    <span style="color: #a61390;">static</span> <span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>CellIdentifier <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Cell&quot;</span>;
&nbsp;
    UITableViewCell <span style="color: #002200;">*</span>cell <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>tableView dequeueReusableCellWithIdentifier<span style="color: #002200;">:</span>CellIdentifier<span style="color: #002200;">&#93;</span>;
    <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>cell <span style="color: #002200;">==</span> <span style="color: #a61390;">nil</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
        cell <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UITableViewCell alloc<span style="color: #002200;">&#93;</span> initWithStyle<span style="color: #002200;">:</span>UITableViewCellStyleDefault reuseIdentifier<span style="color: #002200;">:</span>CellIdentifier<span style="color: #002200;">&#93;</span> autorelease<span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#125;</span>
&nbsp;
	ALAsset <span style="color: #002200;">*</span>asset <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>assets objectAtIndex<span style="color: #002200;">:</span>indexPath.row<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>cell.imageView setImage<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>UIImage imageWithCGImage<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>asset thumbnail<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>cell.textLabel setText<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;Photo %d&quot;</span>, indexPath.row<span style="color: #002200;">+</span><span style="color: #2400d9;">1</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
&nbsp;
    <span style="color: #a61390;">return</span> cell;
<span style="color: #002200;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://icodeblog.com/2010/07/08/asset-libraries-and-blocks-in-ios-4/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>How To Get Booted From The App Store</title>
		<link>http://icodeblog.com/2010/07/06/how-to-get-booted-from-the-app-store/</link>
		<comments>http://icodeblog.com/2010/07/06/how-to-get-booted-from-the-app-store/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 22:33:39 +0000</pubDate>
		<dc:creator>wolfgang</dc:creator>
				<category><![CDATA[AppStore]]></category>
		<category><![CDATA[Featured]]></category>

		<guid isPermaLink="false">http://icodeblog.com/?p=2118</guid>
		<description><![CDATA[<a href="http://icodeblog.com/2010/07/06/how-to-get-booted-from-the-app-store/"><img align="left" hspace="5" width="150" height="150" src="http://icodeblog.com/wp-content/uploads/2010/07/appstoreimages2-150x150.jpg" class="alignleft tfe wp-post-image" alt="appstoreimages2" title="appstoreimages2" /></a>Most of us may scratching their heads over the question how to get some apps into the App Store in the first place. Mozilla, for example, is still hoping that its Home app is making the cut. Once you are in the store, it appears it’s a fair game and you can focus on marketing your app. But you can also do what  Thuat Nguyen has done and get booted from the store altogether. And if you heard about Nguyen already then you might be upset, but, realistically, it was just a matter of time until we would see some fraudulent exploit.]]></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%2Ficodeblog.com%2F2010%2F07%2F06%2Fhow-to-get-booted-from-the-app-store%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ficodeblog.com%2F2010%2F07%2F06%2Fhow-to-get-booted-from-the-app-store%2F&amp;source=elctech&amp;style=normal&amp;hashtags=%23iphonedev" height="61" width="50" /><br />
			</a>
		</div>
<p>Most of us may scratching their heads over the question how to get some apps into the App Store in the first place. Mozilla, for example, is still hoping that its Home app is making the cut. Once you are in the store, it appears it’s a fair game and you can focus on marketing your app. But you can also do what  Thuat Nguyen has done and get booted from the store altogether. And if you heard about Nguyen already then you might be upset, but, realistically, it was just a matter of time until we would see some fraudulent exploit.</p>
<p>What happened is that Nguyen was able to occupy 42 of the top 50 sales positions in the App Store&#8217;s &#8220;book&#8221; category using bogus apps. Interestingly, when Nguyen’s apps appeared, there was also a spike in complaints of iTunes accounts being hacked and being overcharged. Apparently “only” a few hundred accounts were affected until Apple booted Nguyen, which is the good news. The bad news is, of course that the exploit happened and that it may have affected the credibility of tens of thousands of other developers.</p>
<p>Courtesy of <a href="http://www.engadget.com/2010/07/06/apple-responds-on-itunes-fraud-vaguely-confirms-said-fraud/">Engadget</a>, Apple has posted a statement, which reads:</p>
<p><em>The developer Thuat Nguyen and his apps were removed from the App Store for violating the developer Program License Agreement, including fraudulent purchase patterns.</em></p>
<p><em>Developers do not receive any iTunes confidential customer data when an app is downloaded.</em></p>
<p><em>If your credit card or iTunes password is stolen and used on iTunes we recommend that you contact your financial institution and inquire about canceling the card and issuing a chargeback for any unauthorized transactions. We also recommend that you change your iTunes account password immediately. For more information on best practices for password security visit http://www.apple.com/support/itunes.</em></p>
<p>The App Store and Apple’s tight grip on what is published and what not through, let’s be honest, a walled garden approach, has always promoted the idea of high quality applications and a sense of security that, for example, Google just can’t provide with Android. But it should be a wake-up call for app buyers as well as developers that the App Store can be exploited in way it was not designed for. This case may have been just a shot in front of the bow and the damage could have been worse.</p>
<p>Of course, Nguyen’s approach was a sure bet to get booted from the App Store and I’d be surprised if that was already everything we have heard about him and Apple. The App Store has been and still is a relatively safe environment to make purchase and I doubt Apple will risk this perception. But, personally, I would wish Apple would be a bit more vocal in its support for developers in this situation. And more vocal to calm potential concerns of consumers. Just silencing the topic does not always work.</p>
<p>A version of the good old neighborhood watch may be the best protection of the community against such fraudulent exploits. However, even on an individual level, you should be making sure that your reputation is not affected by such exploits. More and more consumers may be trying to find ways to determine whether an app is real or not and you should make it as easy as possible for them to figure that out. Make sure you have a functioning web site and an active support section. Make sure you can be contacted and maintain a public persona, perhaps through a Facebook page. Public exposure creates confidence and you can use this way to earn trust. </p>
]]></content:encoded>
			<wfw:commentRss>http://icodeblog.com/2010/07/06/how-to-get-booted-from-the-app-store/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Mindshare Migration: Mobile Developers Care About Revenue</title>
		<link>http://icodeblog.com/2010/07/05/mindshare-migration-mobile-developers-care-about-revenue/</link>
		<comments>http://icodeblog.com/2010/07/05/mindshare-migration-mobile-developers-care-about-revenue/#comments</comments>
		<pubDate>Mon, 05 Jul 2010 18:23:22 +0000</pubDate>
		<dc:creator>wolfgang</dc:creator>
				<category><![CDATA[AppStore]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[app store]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://icodeblog.com/?p=2092</guid>
		<description><![CDATA[<a href="http://icodeblog.com/2010/07/05/mindshare-migration-mobile-developers-care-about-revenue/"><img align="left" hspace="5" width="150" height="150" src="http://icodeblog.com/wp-content/uploads/2010/07/iphone4-150x150.jpg" class="alignleft tfe wp-post-image" alt="iphone4" title="iphone4" /></a>Vision Mobile has just posted one of the more impressive research reports and surveys that focus on mobile application development. This new report, called Mobile Developer Economics 2010: The migration of developer mindshare examines facts and emotions that guide developers these days in their efforts to make a living from app development. The survey included 400 developers across 8 platforms (iOS (iPhone), Android, Symbian, BlackBerry, Java ME, Windows Phone, Flash Lite, and mobile web.)]]></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%2Ficodeblog.com%2F2010%2F07%2F05%2Fmindshare-migration-mobile-developers-care-about-revenue%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ficodeblog.com%2F2010%2F07%2F05%2Fmindshare-migration-mobile-developers-care-about-revenue%2F&amp;source=elctech&amp;style=normal&amp;hashtags=app+store,iphone" height="61" width="50" /><br />
			</a>
		</div>
<p>Vision Mobile has just posted one of the more impressive research reports and surveys that focus on mobile application development. This new report, called Mobile Developer Economics 2010: The migration of developer mindshare examines facts and emotions that guide developers these days in their efforts to make a living from app development. The survey included 400 developers across 8 platforms (iOS (iPhone), Android, Symbian, BlackBerry, Java ME, Windows Phone, Flash Lite, and mobile web.)</p>
<p><a href="http://icodeblog.com/wp-content/uploads/2010/07/visionmobile.jpg"><img class="aligncenter size-full wp-image-2094" title="visionmobile" src="http://icodeblog.com/wp-content/uploads/2010/07/visionmobile.jpg" alt="" width="500" height="312" /></a></p>
<p>The 57 pages are easily considered a must read if you are interested in competitive app development, publishing and marketing in any way, as the data lets you keep an eye on your colleagues and rivals and possibly reveal one or the other surprise.</p>
<p>Vision Mobile’s survey found that Android is carrying the mind share right now, as 60% of its respondents said that they recently developed for that platform. iOS follows in second place and then, … well, then there is really nothing after that as far as mindshare migration is concerned as those two platforms are described as leading the “industrial revolution era” of the mobile app development space:</p>
<p>From the report: <em>“The next five years will completely remap the mobile industry landscape. RIM and Apple, two verticalised companies, move into the top five, displacing the incumbents, leaving one Finnish and two Korean companies in pole position. The operating system landscape will consolidate into two tiers; the top-end open to iconic products dominated by Apple and followed by the iPhone clones powered by Android; and the feature-phone market where licensable operating systems (Android and BREW) will finally allow handset OEMs to move away from legacy RTOS platforms. Google’s Android will also power a diverse range of new form factors, from picture frames to car dashboards, offering for the first time a simplified platform from which to achieve convergent interconnected services. In this age of Industrial Revolution, mobile developers will be responsible for most of the innovation on mobile devices, and can act independently from the mobile industry powers-that-be – OEMs or network operators – to get their applications to market. In this age, developers have both power and choice.”</em></p>
<p>The lion’s share of the report is dedicated to Android and iOS and if you have ever had competitive questions you might find some answers here.</p>
<p>Among the data that captured my interest was:</p>
<p>- 75% of app developer choose their preferred platform by evaluating the market penetration<br />
- 50% of Windows phone developers have an iPhone<br />
- A standalone developer can expect to sell somewhere between 1000-2000 copies of a $1.99 app<br />
- 5% of iPhone developers said there apps had “very good” revenues<br />
- 27% of iPhone developers said their revenues are as projected<br />
- 24% of iPhone developers reported poor revenues<br />
- The App Store has three times more apps than Android Market, 30 times the apps of Symbian and more than 40 times the apps of Flash Lite.<br />
- 21% of developers say they do not get any support, only ten 10% report very good support</p>
<p>You can discuss why Android carries the mind share and I would have to say that it isn’t entirely clear to me, based on this report. The respondents did criticize Android quite a bit, for example that its App Store model that has virtually no flood gates, makes it harder for high-quality apps to compete. Developers complained about the lack of support, which they can’t even get for money, and they highlighted the lack of documentation of open source platforms, which impacts their development.</p>
<p><em><a href="http://www.visionmobile.com/blog/2010/07/mobile-developer-economics-2010-the-migration-of-developer-mindshare/">You can read the entire report here.</a></em> </p>
]]></content:encoded>
			<wfw:commentRss>http://icodeblog.com/2010/07/05/mindshare-migration-mobile-developers-care-about-revenue/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How Much Data Do We Really Consume?</title>
		<link>http://icodeblog.com/2010/07/01/how-much-data-do-we-really-consume/</link>
		<comments>http://icodeblog.com/2010/07/01/how-much-data-do-we-really-consume/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 16:09:34 +0000</pubDate>
		<dc:creator>wolfgang</dc:creator>
				<category><![CDATA[iphone]]></category>
		<category><![CDATA[AT&T]]></category>
		<category><![CDATA[data usage]]></category>

		<guid isPermaLink="false">http://icodeblog.com/?p=2061</guid>
		<description><![CDATA[<a href="http://icodeblog.com/2010/07/01/how-much-data-do-we-really-consume/"><img align="left" hspace="5" width="150" height="150" src="http://icodeblog.com/wp-content/uploads/2010/07/nielsenwire2-150x150.jpg" class="alignleft tfe wp-post-image" alt="nielsenwire2" title="nielsenwire2" /></a>AT&#038;T caused some waves recently when it simply canceled its flat fee wireless data plan and replaced with two plans that have caps, which, in some scenarios could get rather expensive for the user. Some analysts, such as Jack Gold from J. Gold Associates, have said that efficient data usage of apps may become a part of future wireless benchmarks.]]></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%2Ficodeblog.com%2F2010%2F07%2F01%2Fhow-much-data-do-we-really-consume%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ficodeblog.com%2F2010%2F07%2F01%2Fhow-much-data-do-we-really-consume%2F&amp;source=elctech&amp;style=normal&amp;hashtags=AT%26amp%3BT,data+usage" height="61" width="50" /><br />
			</a>
		</div>
<p>AT&amp;T caused some waves recently when it simply canceled its flat fee wireless data plan and replaced with two plans that have caps, which, in some scenarios could get rather expensive for the user. Some analysts, such as Jack Gold from J. Gold Associates, have said that efficient data usage of apps may become a part of future wireless benchmarks.</p>
<p>However, even if those 200 MB and 2 GB caps sound tight, most of us will have to admit that we simply have no idea how much data we actually consume on our smartphones. Common sense would suggest that there are smartphones that promote data usage and there are some that are too clumsy and create a barrier for data usage. The iPhone, with more than 200,000 apps on tap and countless apps that heavily rely on data, may be among those devices that consume considerable data – which, in fact may have been a reason for AT&amp;T to introduce those new caps just before the introduction of the iPhone 4.</p>
<p>But that does not answer the question how much data we actually consume, of course, and is very much speculation on our part.</p>
<p>Nielsen tried to give some answers by revealing some of the results it got from analyzing 60,000 phone bills. And, as you may imagine, there were some surprises.</p>
<p>What was expected is the fact that increased smartphone data penetration, the availability of more apps and the simple fact that we are getting more comfortable using smartphones results in more data usage. The average monthly data consumption jumped from about 90 MB in January 2009 to about 298 MB in January 2010.</p>
<p>However, Nielsen found that 6% of smartphone users are consuming half of all data. 25% of smartphone users consume less than 1 MB of data. Another 25% do not use any data service, despite the fact that they have signed up for such a plan and pay for it. They use their smartphone only for voice calls and messaging. Nielsen criticized the carriers for this scenario and urged them to do a much better job educating their customers.</p>
<p>More than a third of smartphone users do not subscribe to a data plan at this time. Nielsen said that these users got their smartphones before operators required a data plan.</p>
<p>All these numbers aside, it is somewhat clear that the bandwidth discussion has trickled down from the desktop to the mobile landscape. Data is the new revenue opportunity as voice is commoditized. AT&amp;T is leading the charge, while others with substantial market share may follow soon. Other carriers that have built their business model on a monetary value proposition may have it more difficult to switch to such a model.</p>
<p>In that view, it is interesting to note that, at least for now, AT&amp;T’s new tiered pricing plan may be a good value and not be as expensive as it seems. Nielsen said that 99% of cellphone subscribers are better off with the new model. That is, of course, until applications such as video calling will make it to 3G/4G networks. </p>
]]></content:encoded>
			<wfw:commentRss>http://icodeblog.com/2010/07/01/how-much-data-do-we-really-consume/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>iAd To Debut Tomorrow</title>
		<link>http://icodeblog.com/2010/06/30/iad-to-debut-tomorrow/</link>
		<comments>http://icodeblog.com/2010/06/30/iad-to-debut-tomorrow/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 18:43:50 +0000</pubDate>
		<dc:creator>wolfgang</dc:creator>
				<category><![CDATA[iPhone Articles]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iAd]]></category>
		<category><![CDATA[iOS 4]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://icodeblog.com/?p=2054</guid>
		<description><![CDATA[<a href="http://icodeblog.com/2010/06/30/iad-to-debut-tomorrow/"><img align="left" hspace="5" width="150" height="100" src="http://icodeblog.com/wp-content/uploads/2010/06/iad1-150x100.jpg" class="alignleft tfe wp-post-image" alt="iad" title="iad" /></a>Apple will be rolling on its iAd service on Thursday and open up a potentially very lucrative revenue source for application developers as well as another revenue source for itself. It’s a high-rollers market now, but don’t expect mass advertisers to be playing ball just yet.
]]></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%2Ficodeblog.com%2F2010%2F06%2F30%2Fiad-to-debut-tomorrow%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ficodeblog.com%2F2010%2F06%2F30%2Fiad-to-debut-tomorrow%2F&amp;source=elctech&amp;style=normal&amp;hashtags=iAd,iOS+4,iphone" height="61" width="50" /><br />
			</a>
		</div>
<p>Apple will be rolling on its <a href="http://advertising.apple.com/">iAd service</a> on Thursday and open up a potentially very lucrative revenue source for application developers as well as another revenue source for itself. It’s a high-rollers market now, but don’t expect mass advertisers to be playing ball just yet.</p>
<p>Recent reports indicated that iAds are commanding huge premiums. The first row of advertisers is reportedly shelling out at least $1 million each for the privilege to get advertising exposure. If you intend to cover channel exclusivity, the price can top $10 million. Apple recently <a href="http://www.apple.com/pr/library/2010/06/07iads.html">said </a>that it has already sold $60 million in committed ads – which Apple claims is about half of the total committed ad spending for mobile platforms this year. Among the first advertisers are AT&amp;T, Best Buy, Campbell Soup Company, Chanel, Citi, DirecTV, GEICO, GE, JCPenney, Liberty Mutual Group, Nissan, Sears, State Farm, Target, Turner Broadcasting System, Unilever and The Walt Disney Studios.</p>
<p>iAd pricing is the highest in the mobile segment, as far as we know. Banners get $10 for 1000 hits, once click gets $2. It is interesting to note that all ads will be targeting the iPhone initially, as iOS 4 will not be available for the iPad until November. AppleInsider recently wrote that most advertisers are still in the early planning stages for their iAd campaigns and that they aren’t ready to roll their ads out just yet. By the end of the year, iAds should have much greater traction.</p>
<p>Some advertising agencies seem to be unhappy about the fact that Apple controls the technical production of iAds itself. According to AdAge, Apple tells advertisers that it takes about 6 – 8 weeks to run an ad after the artwork has been delivered. However, this fact does not seem to turn down many customers.</p>
<p>&#8220;Any brand that does it is instantly aligned with Apple,&#8221; said Darrell Whitelaw, creative director of mobile shop MIR, which is designing Citi&#8217;s iAd, in an interview with <a href="http://adage.com/digital/article?article_id=144670">AdAge</a>. &#8220;It&#8217;s instant credibility, instant cool. You&#8217;re on the new iPhone 4; it really is the one way you can align yourself with that little Apple logo.&#8221;</p>
<p>iAds require iOS 4, which means that the iPad will not get iAds for now. However, AdAge said that it has noticed iPad campaigns being scheduled for November, which would mean that iOS 4 will be coming to the iPad in that time frame. </p>
]]></content:encoded>
			<wfw:commentRss>http://icodeblog.com/2010/06/30/iad-to-debut-tomorrow/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Google Docs Viewer, Mobile Edition</title>
		<link>http://icodeblog.com/2010/06/29/google-docs-viewer-mobile-edition/</link>
		<comments>http://icodeblog.com/2010/06/29/google-docs-viewer-mobile-edition/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 17:21:03 +0000</pubDate>
		<dc:creator>wolfgang</dc:creator>
				<category><![CDATA[iphone]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://icodeblog.com/?p=2050</guid>
		<description><![CDATA[<a href="http://icodeblog.com/2010/06/29/google-docs-viewer-mobile-edition/"><img align="left" hspace="5" width="150" height="150" src="http://icodeblog.com/wp-content/uploads/2010/04/icon-150x150.png" class="alignleft tfe wp-post-image" alt="icon" title="icon" /></a>Google has just released a new version of its Doc Viewer, which enables iPhone users (and developers) to display various file formats right within the browser windows.]]></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%2Ficodeblog.com%2F2010%2F06%2F29%2Fgoogle-docs-viewer-mobile-edition%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ficodeblog.com%2F2010%2F06%2F29%2Fgoogle-docs-viewer-mobile-edition%2F&amp;source=elctech&amp;style=normal&amp;hashtags=google" height="61" width="50" /><br />
			</a>
		</div>
<p>Google has just released a new version of its Doc Viewer, which enables iPhone users (and developers) to display various file formats right within the browser windows.</p>
<p>The viewer supports Microsoft’s DOC and DOCX formats, as well as DPS, TIFF and PPT. The viewer can be used online at <a href="http://docs.google.com/viewer">http://docs.google.com/viewer</a>.</p>
<p>However, Google also offers an embedded version. The viewer URLs uses the address path <a href="http://docs.google.com/viewer">http://docs.google.com/viewer</a> and supports two parameters: <em>url</em> points to the url of the document and <em>embedded enables </em>the embedded mode interface.</p>
<p>A direct link to a PDF file would look like this:</p>
<p>&lt;a href=&#8221;http://docs.google.com/viewer?url=http%3A%2F%2Fwww.test.com%2F123.pdf&#8221;&gt;Document Test&lt;/a&gt;</p>
<p>The embedded version:</p>
<p>&lt;iframe src=&#8221;http://docs.google.com/viewer?url=http%3A%2F%2Fwww.test.com%2F123.pdf&amp;embedded=true&#8221; width=&#8221;600&#8243; height=&#8221;780&#8243; style=&#8221;border: none;&#8221;&gt;&lt;/iframe&gt; </p>
]]></content:encoded>
			<wfw:commentRss>http://icodeblog.com/2010/06/29/google-docs-viewer-mobile-edition/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>iPhone 4 x 1.7 million = $1,105,000,000</title>
		<link>http://icodeblog.com/2010/06/28/iphone-4-x-1-7-million-1105000000/</link>
		<comments>http://icodeblog.com/2010/06/28/iphone-4-x-1-7-million-1105000000/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 19:01:12 +0000</pubDate>
		<dc:creator>wolfgang</dc:creator>
				<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://icodeblog.com/?p=2046</guid>
		<description><![CDATA[<a href="http://icodeblog.com/2010/06/28/iphone-4-x-1-7-million-1105000000/"><img align="left" hspace="5" width="150" height="150" src="http://icodeblog.com/wp-content/uploads/2010/06/iphonethumb-150x150.jpg" class="alignleft tfe wp-post-image" alt="iphonethumb" title="iphonethumb" /></a>Earlier today, Apple sent out a note stating that it has sold 1.7 million iPhone 4s during the first three days of its availability. No other Apple launch has moved a similar number of units at launch. The original iPhone needed 74 days to hit 1 million, the 3G S sold 1 million units in 3 days and the iPad sold about 1 million units in a month.]]></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%2Ficodeblog.com%2F2010%2F06%2F28%2Fiphone-4-x-1-7-million-1105000000%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ficodeblog.com%2F2010%2F06%2F28%2Fiphone-4-x-1-7-million-1105000000%2F&amp;source=elctech&amp;style=normal&amp;hashtags=iphone" height="61" width="50" /><br />
			</a>
		</div>
<p>Earlier today, Apple sent out a <a href="http://www.apple.com/pr/library/2010/06/28iphone.html">note </a>stating that it has sold 1.7 million iPhone 4s during the first three days of its availability. No other Apple launch has moved a similar number of units at launch. The original iPhone needed 74 days to hit 1 million, the 3G S sold 1 million units in 3 days and the iPad sold about 1 million units in a month.</p>
<p>The economics behind the launch are especially interesting. AT&amp;T and other retailers are believed to pay nearly retail price to Apple for each iPhone, while the profit is mainly made via service contracts. At $600 for the cheaper version of the two iPhone variants, Apple’s iPhone 4 has already shifted more than $1 billion in sales in three days. Some estimates claim that Apple will be selling some 2.5 million iPhones until the end of July.</p>
<p>Market research firm iSuppli has already come up with some other numbers in its teardown report. Apparently it costs Apple about $188 to build and assemble each 16 GB iPhone. The most expensive component remains the screen, which is estimated at $28.50. That may be one of Apple’s best profit margins yet: Typically, the margin is somewhere in the 40-50% neighborhood. The iPhone 4 margin is at close to 70%, if the (unofficial) $599 price tag is correct.</p>
<p>If you order an iPhone 4 now, you will have to wait until the end of July, we hear. And those who don’t want to shell out $200 can get discounts or even free phones in a contest wave that is already flooding the Internet. The most <a href="http://www.youtube.com/watch?v=fLreo24WYeQ">creative idea</a> may come from BlendTec, which said it will give one lucky winner an iPhone and prepay a 2-year service contract. In return, you are asked to surrender your old iPhone, which may end up in iSmoke and ascend to YouTube fame. </p>
]]></content:encoded>
			<wfw:commentRss>http://icodeblog.com/2010/06/28/iphone-4-x-1-7-million-1105000000/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Planning Your App Fortune</title>
		<link>http://icodeblog.com/2010/06/25/planning-your-app-fortune/</link>
		<comments>http://icodeblog.com/2010/06/25/planning-your-app-fortune/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 21:19:07 +0000</pubDate>
		<dc:creator>wolfgang</dc:creator>
				<category><![CDATA[AppStore]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://icodeblog.com/?p=2042</guid>
		<description><![CDATA[<a href="http://icodeblog.com/2010/06/25/planning-your-app-fortune/"><img align="left" hspace="5" width="150" height="150" src="http://icodeblog.com/wp-content/uploads/2010/06/appstore-150x150.jpg" class="alignleft tfe wp-post-image" alt="appstore" title="appstore" /></a>Consider this scenario. You in wonderland. Your app among 200,000 other apps in one store. Plenty of customers: More than 3 billion downloads confirmed. A great new iPhone with brisk demand. An iPad that is breaking sales records and is already beyond what many analysts had predicted initially. Soon there may be 100 million customers that are directly connected to the App Store as their only resource for software. You may already be thinking about an early retirement. Think again.]]></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%2Ficodeblog.com%2F2010%2F06%2F25%2Fplanning-your-app-fortune%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ficodeblog.com%2F2010%2F06%2F25%2Fplanning-your-app-fortune%2F&amp;source=elctech&amp;style=normal&amp;hashtags=AppStore,ipad,iphone" height="61" width="50" /><br />
			</a>
		</div>
<p>Consider this scenario. You in wonderland. Your app among 200,000 other apps in one store. Plenty of customers: More than 3 billion downloads confirmed. A great new iPhone with brisk demand. An iPad that is breaking sales records and is already beyond what many analysts had predicted initially. Soon there may be 100 million customers that are directly connected to the App Store as their only resource for software. You may already be thinking about an early retirement. Think again.</p>
<p>Well, never say never. If you have a great app with mass market appeal becoming a millionaire with a few weeks is not out of the question. There are enough success stories out there. But, of course, there are enough apps out there that get hardly any downloads as well.</p>
<p>So, how exactly do you predict the sales of your future iPhone App? I mean, reasonably?</p>
<p>What should you expect?</p>
<p>Do you aim high or do you aim low?</p>
<p>Heck, what should you aim for at all?</p>
<p>Let’s ignore all those fairy tales of mega-sellers that create instant millionaires for as moment. Of course, it takes a great app, a lot of work, marketing and quite a bit of luck to strike it rich. And if you depend on a very successful app right now while you would be screwed otherwise, you may want to look elsewhere. As it turns out, if you aren’t already a big player, betting on a successful iPhone/iPad app may be a bit like gambling. Or like launching a website that promised gazillions of dollars of ad revenues.</p>
<p>On a reasonable level, there has been a recent <a href="http://www.brightsideofnews.com/news/2010/6/22/full-disclosure-iphone-apps-business.aspx">article</a> that has caught my attention. It takes a much more conservative look (a very conservative look, in fact) at what the average app earns. It could be a bit frustrating to read, but it may help to adjust some expectations.</p>
<p>The BSN article dives deep into publicly available numbers and draws conclusions by using numbers that may not be accurate, which is why we should take them with a grain of salt. The foundation for the calculated revenue is Apple’s publicly disclosed figures of currently $542 million of revenues in the first half of the year. The app average does not sound too bad, but this is, of course, a distorted view since, as so often, 5% of the paid apps are generally believed to account for 95% of the revenues. 200,000 apps and $542 million would mean that the average app author gets $2710 every six months, which is not that great, but then we know that the majority of downloads are free downloads (according to BSN about 85% of downloads are free, while they represent only 27% of the App Stores stock), but a few apps rake in millions while others just a few dollars.</p>
<p>BSN quotes market researchers who believe that the average price paid for an app is somewhere between $1.90 and $2. The average app gets less than 1000 downloads over a 2-year period and if we apply a median number of $1.95, then the media revenue would be about $1950 per app over two years, or $682 per year after Apple’s 30% cut. Building a business on that would be kinda foolish, of course.</p>
<p>But then, this is really a very conservative scenario. If you are enthusiastic about your app, and you have a powerful social network that can help you market your app, or have other resources to get you going, you may very well end up north of that median. BSN also noted that each iPhone/iPad is estimated to generate about 7 paid downloads and 40 free downloads per year. With 100 million outs in the market soon, that is a substantial opportunity. And it is up to you how you take advantage of this opportunity. </p>
]]></content:encoded>
			<wfw:commentRss>http://icodeblog.com/2010/06/25/planning-your-app-fortune/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How Many iPads Can Apple Sell?</title>
		<link>http://icodeblog.com/2010/06/24/how-many-ipads-can-apple-sell/</link>
		<comments>http://icodeblog.com/2010/06/24/how-many-ipads-can-apple-sell/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 15:00:11 +0000</pubDate>
		<dc:creator>wolfgang</dc:creator>
				<category><![CDATA[ipad]]></category>

		<guid isPermaLink="false">http://icodeblog.com/?p=2038</guid>
		<description><![CDATA[<a href="http://icodeblog.com/2010/06/24/how-many-ipads-can-apple-sell/"><img align="left" hspace="5" width="150" height="150" src="http://icodeblog.com/wp-content/uploads/2010/06/ipad-150x150.jpg" class="alignleft tfe wp-post-image" alt="ipad" title="ipad" /></a>Predicting the potential customer base for your application is not that easy. It has become clear that especially the iPad has become a moving target that should be taken seriously. Latest sales numbers are proof that it is worth your while to make sure that you app runs well on both the iPhone and the iPad. ]]></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%2Ficodeblog.com%2F2010%2F06%2F24%2Fhow-many-ipads-can-apple-sell%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ficodeblog.com%2F2010%2F06%2F24%2Fhow-many-ipads-can-apple-sell%2F&amp;source=elctech&amp;style=normal&amp;hashtags=ipad" height="61" width="50" /><br />
			</a>
		</div>
<p>Predicting the potential customer base for your application is not that easy. It has become clear that especially the iPad has become a moving target that should be taken seriously. Latest sales numbers are proof that it is worth your while to make sure that you app runs well on both the iPhone and the iPad. <a href="http://icodeblog.com/wp-content/uploads/2010/06/ipad.jpg"><img class="alignleft size-full wp-image-2039" title="ipad" src="http://icodeblog.com/wp-content/uploads/2010/06/ipad.jpg" alt="" width="200" height="249" /></a></p>
<p>Apple said that 3 million iPads have been sold in 80 days. That works out to about 37,500 iPads every day. While this number is impressive, Apple’s numbers also suggest that iPad sales are climbing beyond the initial sales volume right after launch. As far as we know, it took Apple 28 days to sell the first million of iPads. It took about (we don’t know the exact count) 30 days to sell the second million and apparently about 22 days for the third million.</p>
<p>There was some speculation that overall sales could die down, but it seems that international demand is actually accelerating the demand. There have been some colorful comparisons, as Apple highlighted the “80 days” mark and mentioned that Apple will be making the iPad available to more people around the world. So Apple sold 3 million iPads in the same time Phileas Fogg traveled around the world in Jules Verne’s 1873 novel Around the World in Eighty Days. But in case you are wondering, of course, the iPads solds would not be able to make it “around the world.”  If placed end-to end, the line of iPads would stretch for about 452 miles. Apple will have to sell 165,067,381 iPads to make it once around the globe.</p>
<p>Not surprisingly, Apple’s new estimate has brought updated sales estimates from analysts, which have been somewhere between 5 and 7 million for this year, with the exception of Forrester, which was, as far as we know, the only research firm that indicated a slowdown of iPad sales, as they believe 3.5 million tablets (including the iPad) will be sold this year. Piper Jaffray’s Gene Munster now believes that Apple will sell 7.5 million iPads in 2010, up from a previous estimate of 6.2 million. By the end of 2011, Apple will have sold 16.5 million iPads, Munster said in a research note to his clients.</p>
<p>Given the fact that the sales estimates that most analysts covering the iPad have revised their estimates at least half a dozen times this year already, I wonder where we really will end up by the end of the year? </p>
]]></content:encoded>
			<wfw:commentRss>http://icodeblog.com/2010/06/24/how-many-ipads-can-apple-sell/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>iOS 4: Please start your engines.</title>
		<link>http://icodeblog.com/2010/06/23/ios-4-please-start-your-engines/</link>
		<comments>http://icodeblog.com/2010/06/23/ios-4-please-start-your-engines/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 18:07:02 +0000</pubDate>
		<dc:creator>wolfgang</dc:creator>
				<category><![CDATA[iPhone Articles]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[iOS4]]></category>

		<guid isPermaLink="false">http://icodeblog.com/?p=2032</guid>
		<description><![CDATA[<a href="http://icodeblog.com/2010/06/23/ios-4-please-start-your-engines/"><img align="left" hspace="5" width="150" height="150" src="http://icodeblog.com/wp-content/uploads/2010/06/ios4-150x150.jpg" class="alignleft tfe wp-post-image" alt="ios4" title="ios4" /></a>It is not particularly difficult to figure that Apple will push this release hard. There is some competition out there and we expect Apple to step up the marketing game even more, which should create new ways to ride in Apple’s tailwind to market your application. Make sure you are ready for this opportunity. It’s a growing market that quickly rewards your creativity and innovation.]]></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%2Ficodeblog.com%2F2010%2F06%2F23%2Fios-4-please-start-your-engines%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ficodeblog.com%2F2010%2F06%2F23%2Fios-4-please-start-your-engines%2F&amp;source=elctech&amp;style=normal&amp;hashtags=iOS4" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://icodeblog.com/wp-content/uploads/2010/06/ios4.jpg"><img class="size-full wp-image-2033 alignleft" title="ios4" src="http://icodeblog.com/wp-content/uploads/2010/06/ios4.jpg" alt="" width="157" height="160" /></a>If you haven’t done so yet (not that we believe you didn’t), it’s a good time now to have a closer look at Apple’s new iOS 4, which was officially rolled out yesterday.</p>
<p>So we have known about it for two months and talked about it a <a href="../../../../../2010/04/08/iphone-os-4-0-the-death-of-the-3gmu/">couple times</a>. In numbers, there are 100 new features and access to more than 1500 APIs, with details being provided by Apple on its <a href="http://developer.apple.com/technologies/iphone/whats-new.html">SDK site</a>.</p>
<p>There is a lot of focus on the new features (Ars Technica has the most thorough <a href="http://arstechnica.com/apple/reviews/2010/06/ars-reviews-ios-4-whats-new-and-notable.ars">first look</a> we have seen so far), but given Apple’s emphasis on iOS 4, the real news may not be so much new APIs or features, such as multitasking, per se. It’s the collective opportunity behind it.</p>
<p>Of course, there will be a race who will have the first apps out that use some of those new features, but it may the app that finds a way to take an intuitive approach to leverage iOS 4 features that will come out on top. It is a comprehensive update that can be overwhelming and clearly needs some thought. Perhaps that was the reason why Apple has given us more than two months to prepare for this release, if you think about it.</p>
<p>It is not particularly difficult to figure that Apple will push this release hard. There is some competition out there and we expect Apple to step up the marketing game even more, which should create new ways to ride in Apple’s tailwind to market your application. Make sure you are ready for this opportunity. It’s a growing market that quickly rewards your creativity and innovation.</p>
<p>We will spending quite a bit of time with iOS4 over the next few weeks, so make sure you check back frequently. </p>
]]></content:encoded>
			<wfw:commentRss>http://icodeblog.com/2010/06/23/ios-4-please-start-your-engines/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>iPhone 4 Could Propel Apple to 100 million users</title>
		<link>http://icodeblog.com/2010/06/21/iphone-4-could-propel-apple-to-100-million-users/</link>
		<comments>http://icodeblog.com/2010/06/21/iphone-4-could-propel-apple-to-100-million-users/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 20:49:41 +0000</pubDate>
		<dc:creator>wolfgang</dc:creator>
				<category><![CDATA[iPhone Articles]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://icodeblog.com/?p=2027</guid>
		<description><![CDATA[<a href="http://icodeblog.com/2010/06/21/iphone-4-could-propel-apple-to-100-million-users/"><img align="left" hspace="5" width="150" height="150" src="http://icodeblog.com/wp-content/uploads/2010/06/iphoneicode-150x150.jpg" class="alignleft tfe wp-post-image" alt="iphoneicode" title="iphoneicode" /></a>It is no secret anymore that Apple is shattering pre-sales records with the new iPhone. Apparently, more than 600,000 phones have been ordered in just one day. What is much more interesting, are the forecasts just how far this new phone can go. Morgan Stanley’s Katy Huberty thinks  Apple may be able to expand its user base to 100 million iPhone owners and users. She believes that about 42 million fourth-generation iPhones could be sold by the end of the year.]]></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%2Ficodeblog.com%2F2010%2F06%2F21%2Fiphone-4-could-propel-apple-to-100-million-users%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ficodeblog.com%2F2010%2F06%2F21%2Fiphone-4-could-propel-apple-to-100-million-users%2F&amp;source=elctech&amp;style=normal&amp;hashtags=apple,iOS,ipad,iphone" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://icodeblog.com/wp-content/uploads/2010/06/iphoneicode.jpg"><a href="http://icodeblog.com/wp-content/uploads/2010/06/iphoneicode.jpg"><img class="alignnone size-medium wp-image-2028" title="iphoneicode" src="http://icodeblog.com/wp-content/uploads/2010/06/iphoneicode-300x184.jpg" alt="" width="300" height="184" /></a></a></p>
<p>It is no secret anymore that Apple is shattering pre-sales records with the new iPhone. Apparently, more than 600,000 phones have been ordered in just one day. What is much more interesting, are the forecasts just how far this new phone can go. Morgan Stanley’s Katy Huberty <a href="http://tech.fortune.cnn.com/2010/06/17/whats-driving-iphone-4-sales/">thinks</a> Apple may be able to expand its user base to 100 million iPhone owners and users. She believes that about 42 million fourth-generation iPhones could be sold by the end of the year.</p>
<p>We know that Huberty is usually among the more optimistic analysts – especially since her rather controversial iPad sales predictions, but even if she is slightly off, those numbers are huge. Huberty thinks that the iPhone 4 is attractive enough so that Apple can triple its user base within 18 months. That should have some impact on its market share which is currently just above 5% of the entire cell phone market, according to Gartner.</p>
<p>So what does that mean for application developers? Obviously that’s good news as the market expands and iPhone/iPad users are getting more and more used to how those apps of a smartphone or tablet work. However, there is another statistic out by ABI Research, which now says that, by 2015, some 1.2 billion apps will be downloaded (Overall, not just Apple). We are not quite sure where that number exactly comes from, especially since ABI quotes the most recent number of more than 200,000 available iPhone apps and we also know that Apple said earlier this year that more than 3 billion apps have been downloaded within 18 months of the launch of the AppStore.</p>
<p>ABI believes that competition will play a role in available apps and app sales and therefore says that downloads will peak sometime during 2012 and 2013. The market research firm noted that there are many apps that do not provide much value. Neil Strother, practice director at ABI, explained: “When considering the value of mobile apps as marketing tools, planners need to take a step back from all the hoopla and ask themselves, ‘How will those work for my brand? Is it right for me? What is my audience doing? Do I even have a large mobile audience? If so, how do I craft an effective strategy?’”</p>
<p>So yes, while we have a tough time finding a way to back up ABI’s numbers, we do agree that app strategy absolutely matters if you are trying to come up with a successful app. </p>
]]></content:encoded>
			<wfw:commentRss>http://icodeblog.com/2010/06/21/iphone-4-could-propel-apple-to-100-million-users/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Diving into the Twitter Stream</title>
		<link>http://icodeblog.com/2010/05/21/diving-into-the-twitter-stream/</link>
		<comments>http://icodeblog.com/2010/05/21/diving-into-the-twitter-stream/#comments</comments>
		<pubDate>Fri, 21 May 2010 21:37:47 +0000</pubDate>
		<dc:creator>Collin</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://icodeblog.com/?p=1981</guid>
		<description><![CDATA[<a href="http://icodeblog.com/2010/05/21/diving-into-the-twitter-stream/"><img align="left" hspace="5" width="150" height="150" src="http://icodeblog.com/wp-content/uploads/2010/05/Twitter-Bird1-150x150.png" class="alignleft tfe wp-post-image" alt="Twitter-Bird" title="Twitter-Bird" /></a>Hey iCoders. As I posted earlier I recently made an iPad app called TweetMapper. I just put out a new release of the app with a big new feature. The app now has a scrolling timeline of the tweets it is seeing as they come in. In order to make this app I took advantage of the Twitter Stream API that is provided by twitter. This API creates a persistent connection between the Twitter servers and your application. We will essentially start a stream of incoming NSData object to an NSURLConnection that you create querying the stream. We will look into the different search parameters which can be passed into the request, the way in which our code responds to authentication requests from Twitter, and the logic we must use to ensure that the data we have received is a complete XML element and not chopped off.]]></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%2Ficodeblog.com%2F2010%2F05%2F21%2Fdiving-into-the-twitter-stream%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ficodeblog.com%2F2010%2F05%2F21%2Fdiving-into-the-twitter-stream%2F&amp;source=elctech&amp;style=normal&amp;hashtags=%23iphonedev" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://icodeblog.com/wp-content/uploads/2010/05/Twitter-Bird.png"><img class="alignleft size-full wp-image-1984" title="Twitter-Bird" src="http://icodeblog.com/wp-content/uploads/2010/05/Twitter-Bird.png" alt="" width="256" height="256" /></a><span style="color: #ff6600;"><br />
</span>Hey iCoders. As I posted earlier I recently made an iPad app called <a title="Tweet Mapper in the App Store" href="http://itunes.apple.com/app/tweet-mapper/id367888965?mt=8" target="_blank">TweetMapper</a>. I just put out a new release of the app with a big new feature. The app now has a scrolling timeline of the tweets it is seeing as they come in. In order to make this app I took advantage of the <a title="Twitter Stream API" href="http://apiwiki.twitter.com/Streaming-API-Documentation" target="_blank">Twitter Stream API</a> that is provided by twitter. This API creates a persistent connection between the Twitter servers and your application. We will essentially start a stream of incoming NSData object to an NSURLConnection that you create querying the stream. We will look into the different search parameters which can be passed into the request, the way in which our code responds to authentication requests from Twitter, and the logic we must use to ensure that the data we have received is a complete XML element and not chopped off. There are three major steps to taking advantage of this in your app.</p>
<ol>
<li>Create an NSURLConnection to request an XML response from the Stream.</li>
<li>Create a parameter string for the HTTP Body.</li>
<li>Respond to the authentication challenge with user credentials.</li>
<li>Append the data as it comes in and when a complete element is received parse the Tweets.</li>
</ol>
<p>So lets dive in.</p>
<h2><span style="color: #ff6600;">Creating the Class</span></h2>
<p>The first thing that we need to do is establish a connection with the Twitter stream. I will not be creating a Twitter client class that can be plugged into any application you choose. You will be able to find the class as a download at the end of the post. We will call the class TwitterStreamClient. Lets first define the header file of the class.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;">#import</span>
<span style="color: #6e371a;">#import &quot;TouchXML.h&quot;</span>
<span style="color: #6e371a;">#import &quot;Tweet.h&quot;</span>
&nbsp;
<span style="color: #a61390;">@interface</span> TwitterClient <span style="color: #002200;">:</span> <span style="color: #400080;">NSObject</span> <span style="color: #002200;">&#123;</span>
&nbsp;
	<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>searchString;
	<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>locationString;
	<span style="color: #400080;">NSMutableString</span> <span style="color: #002200;">*</span>holderString;
	<span style="color: #a61390;">id</span> mapController;
	<span style="color: #400080;">NSURLConnection</span> <span style="color: #002200;">*</span>connection;
	<span style="color: #400080;">NSMutableURLRequest</span> <span style="color: #002200;">*</span>request;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #a61390;">@property</span> <span style="color: #002200;">&#40;</span>nonatomic, assign<span style="color: #002200;">&#41;</span> <span style="color: #a61390;">id</span> mapController;
&nbsp;
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>startStreamingTweets;
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>makeMyRequest;
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>searchByLocation;
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>searchByTerm;
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>searchByUser;
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>parseXMLString<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>xmlString;
<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>locationStringForLongitude<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">double</span><span style="color: #002200;">&#41;</span>_long Latitude<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">double</span><span style="color: #002200;">&#41;</span>_lat;
&nbsp;
<span style="color: #a61390;">@end</span></pre></div></div>

<p>You will need to have TouchXML installed for this class to work. You can find installation instructions <a title="TouchXML Installation" href="http://code.google.com/p/touchcode/wiki/TouchXMLHowTo" target="_blank">here</a>. Let move onto the .m file of the TwitterStreamClient. First thing to do is create the initializer. Ours will look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span>init <span style="color: #002200;">&#123;</span>
	<span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span>self <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>super init<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
		holderString <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSMutableString</span> alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#125;</span>
&nbsp;
	<span style="color: #a61390;">return</span> self;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>This holder string is what we are going to use to synchronize our incoming NSData from the service. We will see the reason for this in the next step.</p>
<h2><span style="color: #ff6600;">Connect to Service</span></h2>
<p><span style="color: #ff6600;"><span style="color: #000000;">The Twitter stream provides many different parameters for users to pass into their request. You can see the full list <a title="Twitter Stream Query Parameters" href="http://apiwiki.twitter.com/Streaming-API-Documentation#QueryParameters" target="_blank">here</a>, but we will be focusing on user specific stream, keyword specific stream and location specific stream. We are going to be hardcoding what these will be searching for but in use you can pass in whatever values you like. We will create an NSMutableURLRequest and fill in its HTTP body with the appropriate request. First we will make a method to create the stream request.</span></span></p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>makeMyRequest <span style="color: #002200;">&#123;</span>
&nbsp;
	request <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSMutableURLRequest</span> alloc<span style="color: #002200;">&#93;</span> initWithURL<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSURL</span> URLWithString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;http://stream.twitter.com/1/statuses/filter.xml&quot;</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>request setHTTPMethod<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;POST&quot;</span><span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>With this done we will create three different methods that can be called. One that bases its search on keywords, another based on users and a final one based on location.</p>
<p>Request by keyword</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>searchByTerm <span style="color: #002200;">&#123;</span>
&nbsp;
	searchString <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;track=Love,Hate,Want,Need&quot;</span>;
&nbsp;
	<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>httpBody <span style="color: #002200;">=</span> searchString;
	<span style="color: #002200;">&#91;</span>request setHTTPBody<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>httpBody dataUsingEncoding<span style="color: #002200;">:</span>NSUTF8StringEncoding<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
	connection <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSURLConnection</span> alloc<span style="color: #002200;">&#93;</span> initWithRequest<span style="color: #002200;">:</span>request delegate<span style="color: #002200;">:</span>self startImmediately<span style="color: #002200;">:</span><span style="color: #a61390;">YES</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>request release<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>Request by User ID</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>searchByUser <span style="color: #002200;">&#123;</span>
&nbsp;
	searchString <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;follow=14402149,29089557,807095,19058681&quot;</span>;
&nbsp;
	<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>httpBody <span style="color: #002200;">=</span> searchString;
	<span style="color: #002200;">&#91;</span>request setHTTPBody<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>httpBody dataUsingEncoding<span style="color: #002200;">:</span>NSUTF8StringEncoding<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
	connection <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSURLConnection</span> alloc<span style="color: #002200;">&#93;</span> initWithRequest<span style="color: #002200;">:</span>request delegate<span style="color: #002200;">:</span>self startImmediately<span style="color: #002200;">:</span><span style="color: #a61390;">YES</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>request release<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>The final method will create a location string. The twitter stream requires passing in 4 coordinates, 2 coordinate pairs. This will define the southwest most point and northeast most point. The square that the coordinates define has a maximum of 1 degree length for any side of the defined box. My helper method takes in a longitude and latitude as a center points and creates as large an area as possible around it and returns the 4 coordinates as a string. Paste in the following code to search with center points on Tempe, AZ and New York, NY.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><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>locationStringForLongitude<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">double</span><span style="color: #002200;">&#41;</span>_long Latitude<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">double</span><span style="color: #002200;">&#41;</span>_lat <span style="color: #002200;">&#123;</span>
&nbsp;
	<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>returnString <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;%f,%f,%f,%f&quot;</span>,<span style="color: #002200;">&#40;</span>_long<span style="color: #002200;">-</span>.5<span style="color: #002200;">&#41;</span>,<span style="color: #002200;">&#40;</span>_lat<span style="color: #002200;">-</span>.5<span style="color: #002200;">&#41;</span>,<span style="color: #002200;">&#40;</span>_long<span style="color: #002200;">+</span>.5<span style="color: #002200;">&#41;</span>,<span style="color: #002200;">&#40;</span>_lat<span style="color: #002200;">+</span>.5<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #a61390;">return</span> returnString;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>searchByLocation <span style="color: #002200;">&#123;</span>
&nbsp;
	searchString <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;locations=%@,%@&quot;</span>,
					  <span style="color: #002200;">&#91;</span>self locationStringForLongitude<span style="color: #002200;">:-</span><span style="color: #2400d9;">111.932898</span> Latitude<span style="color: #002200;">:</span><span style="color: #2400d9;">33.419265</span><span style="color: #002200;">&#93;</span>,
					  <span style="color: #002200;">&#91;</span>self locationStringForLongitude<span style="color: #002200;">:-</span><span style="color: #2400d9;">74.0</span> Latitude<span style="color: #002200;">:</span><span style="color: #2400d9;">40.7</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>httpBody <span style="color: #002200;">=</span> searchString;
	<span style="color: #002200;">&#91;</span>request setHTTPBody<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>httpBody dataUsingEncoding<span style="color: #002200;">:</span>NSUTF8StringEncoding<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
	connection <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSURLConnection</span> alloc<span style="color: #002200;">&#93;</span> initWithRequest<span style="color: #002200;">:</span>request delegate<span style="color: #002200;">:</span>self startImmediately<span style="color: #002200;">:</span><span style="color: #a61390;">YES</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>request release<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<h2><span style="color: #ff6600;">Answering Authentication</span></h2>
<p><span style="color: #000000;">The NSURLConnection will connect to the Twitter stream and then Twitter will ask for a username and password for the request. With the NSURLConnection&#8217;s delegate set to self we will implement the following method to answer the TwitterRequest.</span></p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>connection<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSURLConnection</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>connection didReceiveAuthenticationChallenge<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSURLAuthenticationChallenge</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>challenge <span style="color: #002200;">&#123;</span>
&nbsp;
	<span style="color: #400080;">NSURLCredential</span> <span style="color: #002200;">*</span>cred <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSURLCredential</span> alloc<span style="color: #002200;">&#93;</span> initWithUser<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;USERNAME&quot;</span> password<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;PASSWORD&quot;</span> persistence<span style="color: #002200;">:</span>NSURLCredentialPersistencePermanent<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>challenge sender<span style="color: #002200;">&#93;</span> useCredential<span style="color: #002200;">:</span>cred forAuthenticationChallenge<span style="color: #002200;">:</span>challenge<span style="color: #002200;">&#93;</span>;
	NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Received Challenge&quot;</span><span style="color: #002200;">&#41;</span>;
	<span style="color: #002200;">&#91;</span>cred release<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>This should satisfy the authentication challenge and the stream should start sending you data.</p>
<h2><span style="color: #ff6600;">Receiving Data</span></h2>
<p>Now the stream will start sending you data, it will coming into another NSURLConnection delegate method. The stream will send NSData into this method. The NSData can be parsed into a string and if you print it you will see output like this:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">2010-05-21 14:05:17.491 TweetMapper[72280:207] Recieved Data from Stream:
 2010-05-21 14:05:17.919 TweetMapper[72280:207] Recieved Data from Stream: 
  Fri May 21 21:05:17 +0000 2010
  14452520592
  Need some followers yo I jus got this twitter its pretty str8
  <span style="color: #ddbb00;">&amp;lt;</span>a href=&quot;http://mobile.twitter.com&quot; rel=&quot;nofollow&quot;<span style="color: #ddbb00;">&amp;gt;</span>Twitter for Android<span style="color: #ddbb00;">&amp;lt;</span>/a<span style="color: #ddbb00;">&amp;gt;</span>
false
&nbsp;
  false
&nbsp;
    144901351
    David Powell
    Ballaholic3223
&nbsp;
    I'm a chill dude that love to play ball, hang out,  and uhhhh chillax...holla at me and we can be cool
http://a1.twimg.com/profile_images/907668616/VDG61D80_normal
&nbsp;
false
    1
9ae4e8
000000
0000ff
e0ff92
87bc44
    0
    Mon May 17 16:17:15 +0000 2010
    0</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">2010-05-21 14:05:23.073 TweetMapper[72280:207] Recieved Data from Stream: e_background_color<span style="color: #ddbb00;">&amp;gt;</span>
666666
2FC2EF
252429
181A1E
    5
    Fri Aug 01 08:10:36 +0000 2008
    0
    -28800
    Pacific Time (US <span style="color: #ddbb00;">&amp;amp;</span> Canada)
http://s.twimg.com/a/1274144130/images/themes/theme9/bg.gif
false
&nbsp;
    false
    false
&nbsp;
    44
    en
    false</pre></div></div>

<p>A response from the Twitter stream comes in as XML. An entire XML element that represents a single is a  element. The status element seen here took two different calls to the didRecieveData method. Because of this we need to build in logic to recognize when a complete Tweet XML object is received and pass that onto our parsing method. This is what we use the NSMutableSting holderString for. You can see the completed method below.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>connection<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSURLConnection</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>connection didReceiveData<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSData</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>data <span style="color: #002200;">&#123;</span>
&nbsp;
	<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>dataString <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSString</span> alloc<span style="color: #002200;">&#93;</span> initWithData<span style="color: #002200;">:</span>data encoding<span style="color: #002200;">:</span>NSUTF8StringEncoding<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #002200;">&#91;</span>holderString appendString<span style="color: #002200;">:</span>dataString<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>dataString release<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span>holderString rangeOfString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;&quot;</span><span style="color: #002200;">&#93;</span>.location <span style="color: #002200;">!=</span> NSNotFound <span style="color: #002200;">&amp;</span>amp;<span style="color: #002200;">&amp;</span>amp; <span style="color: #002200;">&#91;</span>holderString rangeOfString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;&quot;</span><span style="color: #002200;">&#93;</span>.location <span style="color: #002200;">!=</span> NSNotFound<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
&nbsp;
		<span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span>holderString rangeOfString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;&quot;</span><span style="color: #002200;">&#93;</span>.location <span style="color: #002200;">&amp;</span>lt; <span style="color: #002200;">&#91;</span>holderString rangeOfString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;&quot;</span><span style="color: #002200;">&#93;</span>.location<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
			<span style="color: #a61390;">NSRange</span> start <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>holderString rangeOfString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;&quot;</span><span style="color: #002200;">&#93;</span>;
			<span style="color: #a61390;">NSRange</span> end <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>holderString rangeOfString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;&quot;</span><span style="color: #002200;">&#93;</span>;
&nbsp;
			<span style="color: #a61390;">NSRange</span> range;
			range.location <span style="color: #002200;">=</span> start.location;
			range.length <span style="color: #002200;">=</span> <span style="color: #002200;">&#40;</span>end.location<span style="color: #002200;">+</span>end.length<span style="color: #002200;">&#41;</span><span style="color: #002200;">-</span>start.location;
&nbsp;
			<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>xmlString <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>holderString substringWithRange<span style="color: #002200;">:</span>range<span style="color: #002200;">&#93;</span>;
&nbsp;
			<span style="color: #002200;">&#91;</span>self parseXMLString<span style="color: #002200;">:</span>xmlString<span style="color: #002200;">&#93;</span>;
&nbsp;
			<span style="color: #002200;">&#91;</span>holderString deleteCharactersInRange<span style="color: #002200;">:</span>range<span style="color: #002200;">&#93;</span>;
		<span style="color: #002200;">&#125;</span>
	<span style="color: #002200;">&#125;</span>
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>Here we receive data and append it to our holder string. We then check that both an opening and closing  element tag is seen. If both tags are seen and the opening tag occurs before the closing tag, we create a substring in that range, pass the completed element to a method called parseXMLString and delete the characters from the holder string.</p>
<h2><span style="color: #ff6600;">Parsing Data</span></h2>
<p>Now that we have completed elements being grabbed out of the data we receive we need to parse out what we find as important. For the sake of extensibility I created a helper object called Tweet. A Tweet takes in tweet text, an author name, the authors Twitter URL, a timestamp, an image URL and a coordinate. This is the header for the class</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;">#import</span>
<span style="color: #6e371a;">#import </span>
&nbsp;
<span style="color: #a61390;">@interface</span> Tweet <span style="color: #002200;">:</span> <span style="color: #400080;">NSObject</span> <span style="color: #002200;">&#123;</span>
&nbsp;
	<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>tweet;
	<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>author;
	<span style="color: #400080;">NSURL</span> <span style="color: #002200;">*</span>authorURL;
	<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>timeStamp;
	<span style="color: #400080;">NSURL</span> <span style="color: #002200;">*</span>authorImageURL;
	CLLocationCoordinate2D coord;
<span style="color: #002200;">&#125;</span>
<span style="color: #a61390;">@property</span> <span style="color: #002200;">&#40;</span>nonatomic, retain<span style="color: #002200;">&#41;</span> <span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>tweet;
<span style="color: #a61390;">@property</span> <span style="color: #002200;">&#40;</span>nonatomic, retain<span style="color: #002200;">&#41;</span> <span style="color: #400080;">NSURL</span> <span style="color: #002200;">*</span>authorImageURL;
<span style="color: #a61390;">@property</span> <span style="color: #002200;">&#40;</span>nonatomic, retain<span style="color: #002200;">&#41;</span> <span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>author;
<span style="color: #a61390;">@property</span> <span style="color: #002200;">&#40;</span>nonatomic, retain<span style="color: #002200;">&#41;</span> <span style="color: #400080;">NSURL</span> <span style="color: #002200;">*</span>authorURL;
<span style="color: #a61390;">@property</span> <span style="color: #002200;">&#40;</span>nonatomic, retain<span style="color: #002200;">&#41;</span> <span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>timeStamp;
<span style="color: #a61390;">@property</span> <span style="color: #002200;">&#40;</span>nonatomic, assign<span style="color: #002200;">&#41;</span> CLLocationCoordinate2D coord;
&nbsp;
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span>UIImage<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>authorPhoto;
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSURL</span><span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>tweetLink;
&nbsp;
<span style="color: #a61390;">@end</span></pre></div></div>

<p>I implement the class like this. I include a method called TweetLink which will return an NSURL of any url within the tweet text.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;">#import &quot;Tweet.h&quot;</span>
&nbsp;
<span style="color: #a61390;">@implementation</span> Tweet
&nbsp;
<span style="color: #a61390;">@synthesize</span> tweet;
<span style="color: #a61390;">@synthesize</span> authorImageURL;
<span style="color: #a61390;">@synthesize</span> author;
<span style="color: #a61390;">@synthesize</span> authorURL;
<span style="color: #a61390;">@synthesize</span> timeStamp;
<span style="color: #a61390;">@synthesize</span> coord;
&nbsp;
<span style="color: #002200;">-</span>init <span style="color: #002200;">&#123;</span>
&nbsp;
	<span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span>super init<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
&nbsp;
	<span style="color: #002200;">&#125;</span>
&nbsp;
	<span style="color: #a61390;">return</span> self;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSURL</span><span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>tweetLink <span style="color: #002200;">&#123;</span>
	<span style="color: #a61390;">NSRange</span> httpRange <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>self tweet<span style="color: #002200;">&#93;</span> rangeOfString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;http://&quot;</span><span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span>httpRange.location <span style="color: #002200;">==</span> NSNotFound<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
		<span style="color: #a61390;">return</span> <span style="color: #a61390;">nil</span>;
	<span style="color: #002200;">&#125;</span>
&nbsp;
	<span style="color: #a61390;">else</span> <span style="color: #002200;">&#123;</span>
		httpRange.length <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>self tweet<span style="color: #002200;">&#93;</span> length<span style="color: #002200;">&#93;</span> <span style="color: #002200;">-</span> httpRange.location;
		<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>customString <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>self tweet<span style="color: #002200;">&#93;</span> substringWithRange<span style="color: #002200;">:</span>httpRange<span style="color: #002200;">&#93;</span>;
		httpRange <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>customString rangeOfString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot; &quot;</span><span style="color: #002200;">&#93;</span>;
&nbsp;
		<span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span>httpRange.location <span style="color: #002200;">==</span> NSNotFound<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
&nbsp;
			httpRange.location <span style="color: #002200;">=</span> <span style="color: #2400d9;">0</span>;
			httpRange.length <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>customString length<span style="color: #002200;">&#93;</span>;
		<span style="color: #002200;">&#125;</span>
&nbsp;
		<span style="color: #a61390;">else</span> <span style="color: #002200;">&#123;</span>
			httpRange.length <span style="color: #002200;">=</span> httpRange.location;
			httpRange.location <span style="color: #002200;">=</span> <span style="color: #2400d9;">0</span>;
		<span style="color: #002200;">&#125;</span>
&nbsp;
		NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;URL I am returning: %@&quot;</span>, <span style="color: #002200;">&#91;</span>customString substringWithRange<span style="color: #002200;">:</span>httpRange<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>;
&nbsp;
		<span style="color: #a61390;">return</span> <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSURL</span> URLWithString<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>customString substringWithRange<span style="color: #002200;">:</span>httpRange<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#125;</span>
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span>UIImage<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>authorPhoto <span style="color: #002200;">&#123;</span>
&nbsp;
	<span style="color: #a61390;">return</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIImage alloc<span style="color: #002200;">&#93;</span> initWithData<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSData</span> dataWithContentsOfURL<span style="color: #002200;">:</span>authorURL<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<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>description <span style="color: #002200;">&#123;</span>
&nbsp;
	<span style="color: #a61390;">return</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;Tweet:%@<span style="color: #2400d9;">\n</span>Author:%@<span style="color: #2400d9;">\n</span>Author URL:%@<span style="color: #2400d9;">\n</span>Published:%@<span style="color: #2400d9;">\n</span>Longitude:%f<span style="color: #2400d9;">\n</span>Latitude:%f<span style="color: #2400d9;">\n</span>Author Image URL:%@&quot;</span>, tweet, author, authorURL, timeStamp,coord.longitude,coord.latitude, authorImageURL<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span>
<span style="color: #a61390;">@end</span></pre></div></div>

<p>I will use this class to create a single object holding all of the data I parse out of the XML elements I am looking at. All that is left to do is finish my parse method to get create these Tweet objects. This is my parse method that takes advantage of Touch XML and its awesome XML parsing methods.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>parseXMLString<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>xmlString <span style="color: #002200;">&#123;</span>
&nbsp;
	CXMLDocument <span style="color: #002200;">*</span>document <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>CXMLDocument alloc<span style="color: #002200;">&#93;</span> initWithXMLString<span style="color: #002200;">:</span>xmlString options<span style="color: #002200;">:</span><span style="color: #2400d9;">0</span> error<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>document rootElement<span style="color: #002200;">&#93;</span> elementsForName<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;geo&quot;</span><span style="color: #002200;">&#93;</span> objectAtIndex<span style="color: #002200;">:</span><span style="color: #2400d9;">0</span><span style="color: #002200;">&#93;</span> childCount<span style="color: #002200;">&#93;</span> <span style="color: #002200;">&amp;</span>gt; <span style="color: #2400d9;">0</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
&nbsp;
		Tweet <span style="color: #002200;">*</span>tweet <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>Tweet alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;
&nbsp;
		<span style="color: #002200;">&#91;</span>tweet setTweet<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>document rootElement<span style="color: #002200;">&#93;</span> elementsForName<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;text&quot;</span><span style="color: #002200;">&#93;</span> objectAtIndex<span style="color: #002200;">:</span><span style="color: #2400d9;">0</span><span style="color: #002200;">&#93;</span> stringValue<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
		<span style="color: #002200;">&#91;</span>tweet setAuthor<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;@%@&quot;</span>, <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>document rootElement<span style="color: #002200;">&#93;</span> elementsForName<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;user&quot;</span><span style="color: #002200;">&#93;</span> objectAtIndex<span style="color: #002200;">:</span><span style="color: #2400d9;">0</span><span style="color: #002200;">&#93;</span> elementsForName<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;screen_name&quot;</span><span style="color: #002200;">&#93;</span> objectAtIndex<span style="color: #002200;">:</span><span style="color: #2400d9;">0</span><span style="color: #002200;">&#93;</span> stringValue<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
		<span style="color: #002200;">&#91;</span>tweet setAuthorURL<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSURL</span> URLWithString<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>document rootElement<span style="color: #002200;">&#93;</span> elementsForName<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;user&quot;</span><span style="color: #002200;">&#93;</span> objectAtIndex<span style="color: #002200;">:</span><span style="color: #2400d9;">0</span><span style="color: #002200;">&#93;</span> elementsForName<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;url&quot;</span><span style="color: #002200;">&#93;</span> objectAtIndex<span style="color: #002200;">:</span><span style="color: #2400d9;">0</span><span style="color: #002200;">&#93;</span> stringValue<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
		<span style="color: #002200;">&#91;</span>tweet setAuthorImageURL<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSURL</span> URLWithString<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>document rootElement<span style="color: #002200;">&#93;</span> elementsForName<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;user&quot;</span><span style="color: #002200;">&#93;</span> objectAtIndex<span style="color: #002200;">:</span><span style="color: #2400d9;">0</span><span style="color: #002200;">&#93;</span> elementsForName<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;profile_image_url&quot;</span><span style="color: #002200;">&#93;</span> objectAtIndex<span style="color: #002200;">:</span><span style="color: #2400d9;">0</span><span style="color: #002200;">&#93;</span> stringValue<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
&nbsp;
		<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>coordinateString <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>document rootElement<span style="color: #002200;">&#93;</span> elementsForName<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;geo&quot;</span><span style="color: #002200;">&#93;</span> objectAtIndex<span style="color: #002200;">:</span><span style="color: #2400d9;">0</span><span style="color: #002200;">&#93;</span> elementsForName<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;point&quot;</span><span style="color: #002200;">&#93;</span> objectAtIndex<span style="color: #002200;">:</span><span style="color: #2400d9;">0</span><span style="color: #002200;">&#93;</span> stringValue<span style="color: #002200;">&#93;</span>;
		<span style="color: #a61390;">NSRange</span> range <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>coordinateString rangeOfString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot; &quot;</span><span style="color: #002200;">&#93;</span>;
		<span style="color: #a61390;">NSRange</span> lon;
		lon.location <span style="color: #002200;">=</span> <span style="color: #2400d9;">0</span>;
		lon.length <span style="color: #002200;">=</span> range.location;
		<span style="color: #a61390;">NSRange</span> lat;
		lat.location <span style="color: #002200;">=</span> range.location<span style="color: #002200;">+</span>range.length;
		lat.length <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>coordinateString length<span style="color: #002200;">&#93;</span> <span style="color: #002200;">-</span> lat.location;
&nbsp;
		<span style="color: #a61390;">double</span> longit <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>coordinateString substringWithRange<span style="color: #002200;">:</span>lon<span style="color: #002200;">&#93;</span> doubleValue<span style="color: #002200;">&#93;</span>;
		<span style="color: #a61390;">double</span> latit <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>coordinateString substringWithRange<span style="color: #002200;">:</span>lat<span style="color: #002200;">&#93;</span> doubleValue<span style="color: #002200;">&#93;</span>;
&nbsp;
		CLLocationCoordinate2D coord;
		coord.longitude <span style="color: #002200;">=</span> latit;
		coord.latitude <span style="color: #002200;">=</span> longit;
&nbsp;
		<span style="color: #002200;">&#91;</span>tweet setCoord<span style="color: #002200;">:</span>coord<span style="color: #002200;">&#93;</span>;
&nbsp;
		<span style="color: #11740a; font-style: italic;">//PASS TWEET ONTO WHATEVER CLASS WILL USE IT</span>
&nbsp;
		<span style="color: #002200;">&#91;</span>tweet release<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#125;</span>
<span style="color: #002200;">&#125;</span></pre></div></div>

<h2><span style="color: #ff6600;">Usage</span></h2>
<p>Make sure that you install Touch XML and import the MapKit framework when using this class. Customize the terms, users and coordinates for the stream method to fit what you need it for. All that will be required to use the class is the following to create and begin parsing:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">TwitterClient <span style="color: #002200;">*</span>client <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>TwitterClient alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#91;</span>client makeMyRequest<span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #002200;">&#91;</span>client searchByTerm<span style="color: #002200;">&#93;</span>;
&nbsp;
OR
&nbsp;
<span style="color: #002200;">&#91;</span>client searchByLocation<span style="color: #002200;">&#93;</span>;
&nbsp;
OR
&nbsp;
<span style="color: #002200;">&#91;</span>client searchByUser<span style="color: #002200;">&#93;</span>;</pre></div></div>

<p>Fillin the very end of the parsing method to send the tweets off to whatever part of the application you want to use them in. I hope this introduction will help you guys add live twitter streams into your apps. Happy coding!</p>
<h2><span style="color: #ff6600;">Source Downloads</span></h2>
<p><a href="http://icodeblog.com/wp-content/uploads/2010/05/TwitterStream2.zip">TwitterStream</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://icodeblog.com/2010/05/21/diving-into-the-twitter-stream/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
