<?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>MacOSCoders &#187; iPhone Applications</title>
	<atom:link href="http://www.macoscoders.com/category/iphone-applications/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.macoscoders.com</link>
	<description>My blog to talk on iPhone, Mac OS, Adobe Flex, AIR...</description>
	<lastBuildDate>Mon, 16 Aug 2010 10:45:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>In-App SMS in iPhone OS 4.0</title>
		<link>http://www.macoscoders.com/2010/08/12/in-app-sms-in-iphone-os-4-0/</link>
		<comments>http://www.macoscoders.com/2010/08/12/in-app-sms-in-iphone-os-4-0/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 08:02:07 +0000</pubDate>
		<dc:creator>Anish Kumar</dc:creator>
				<category><![CDATA[iPhone Applications]]></category>
		<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[in-app]]></category>
		<category><![CDATA[MFMessageComposeViewController]]></category>
		<category><![CDATA[sms]]></category>

		<guid isPermaLink="false">http://www.macoscoders.com/?p=433</guid>
		<description><![CDATA[With iPhone OS 4.0 and above we can send SMS right from within our application. Now our application can invoke the SMS composer screen just like we invoke the Mail composer screen. We need to invoke an instance of MFMessageComposeViewController and assign the delegate, recipients and body of the SMS. The code snippet is provided [...]]]></description>
			<content:encoded><![CDATA[<p>With iPhone OS 4.0 and above we can send SMS right from within our application. Now our application can invoke the SMS composer screen just like we invoke the Mail composer screen. We need to invoke an instance of MFMessageComposeViewController and assign the delegate, recipients and body of the SMS. The code snippet is provided below:</p>
<p><span id="more-433"></span></p>
<p><code> MFMessageComposeViewController *controller = [[[MFMessageComposeViewController alloc] init] autorelease];<br />
if([MFMessageComposeViewController canSendText])<br />
{<br />
controller.body = @"A test message from http://www.macoscoders.com";<br />
controller.recipients = [NSArray arrayWithObjects:@"9880182343",nil];<br />
controller.messageComposeDelegate = self;<br />
[self presentModalViewController:controller animated:YES];<br />
}</code></p>
<p>The MFMessageComposeViewController invoking class can implement the below delegate method to know the result of the SMS sending operation.</p>
<p><code>- (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result</code></p>
<p>You can<a href="http://www.macoscoders.com/downloads/SMSTester.zip"> download sample XCode project source here</a></p>
<p><script type="text/javascript">// <![CDATA[
 branchr_client_id = '1l5n38byc2y6nl5vk7wc88in7k'; branchr_ad_width = 234; branchr_ad_height = 60; branchr_ad_format = 12;
// ]]&gt;</script><br />
<script src="http://static.branchr.com/serve.js?1248290004" type="text/javascript"></script></p>
<div id="wherego_related"> </div>]]></content:encoded>
			<wfw:commentRss>http://www.macoscoders.com/2010/08/12/in-app-sms-in-iphone-os-4-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Problem With FBDialog Cancel Button</title>
		<link>http://www.macoscoders.com/2010/07/21/problem-with-fbdialog-cancel-button/</link>
		<comments>http://www.macoscoders.com/2010/07/21/problem-with-fbdialog-cancel-button/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 10:25:42 +0000</pubDate>
		<dc:creator>Anish Kumar</dc:creator>
				<category><![CDATA[IPhone]]></category>
		<category><![CDATA[iPhone Applications]]></category>
		<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[dialogDidCancel]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[fbconnect]]></category>
		<category><![CDATA[FBDialog]]></category>

		<guid isPermaLink="false">http://www.macoscoders.com/?p=430</guid>
		<description><![CDATA[The FBConnects&#8217;s FBDialog class has a problem with the cancel button. When user taps the cancel button, the delegate method &#8220;dismissWithSuccess&#8221; is called instead of &#8220;dialogDidCancel&#8220;. This flaw in the FBConnect SDK makes it difficult to determine whether the user has tapped on cancel button or not. We can overcome this issue by editing FBDialog.m [...]]]></description>
			<content:encoded><![CDATA[<p>The FBConnects&#8217;s FBDialog class has a problem with the cancel button. When user taps the cancel button, the delegate method &#8220;<code>dismissWithSuccess</code>&#8221; is called instead of &#8220;<code>dialogDidCancel</code>&#8220;. This flaw in the FBConnect SDK makes it difficult to determine whether the user has tapped on cancel button or not. We can overcome this issue by editing FBDialog.m in the FBConnect. Add the below code as the first line in FBDialog.m&#8217;s <code>webViewDidFinishLoad :</code> methods</p>
<p style="padding-left: 30px;"><code>[_webView stringByEvaluatingJavaScriptFromString:@"document.getElementById('cancel').onclick = function onclick(event) { window.location.href = 'fbconnect:cancel'; }"];</code></p>
<p style="padding-left: 30px;">
<p> This should fix the issue and <code>dialogDidCancel</code> should get called correctly..!<br />
<script type="text/javascript"><!--
branchr_client_id = '1l5n38byc2y6nl5vk7wc88in7k';
branchr_ad_width = 468;
branchr_ad_height = 60;
branchr_ad_format = 11;
//--></script><br />
<script type="text/javascript" src="http://static.branchr.com/serve.js?1248290004"></script></p>
<div id="wherego_related"> </div>]]></content:encoded>
			<wfw:commentRss>http://www.macoscoders.com/2010/07/21/problem-with-fbdialog-cancel-button/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Localizing Settings.bundle</title>
		<link>http://www.macoscoders.com/2010/04/12/localizing-settings-bundle/</link>
		<comments>http://www.macoscoders.com/2010/04/12/localizing-settings-bundle/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 09:21:50 +0000</pubDate>
		<dc:creator>Anish Kumar</dc:creator>
				<category><![CDATA[IPhone]]></category>
		<category><![CDATA[iPhone Applications]]></category>
		<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[internationalization]]></category>
		<category><![CDATA[localization]]></category>
		<category><![CDATA[preference]]></category>
		<category><![CDATA[settings]]></category>

		<guid isPermaLink="false">http://www.macoscoders.com/?p=403</guid>
		<description><![CDATA[For adding internationalization support to iPhone Settings.bundle, follow these steps:-
1. Close the Xcode IDE
2. Drag and duplicate the settings bundle onto the desktop (or wherever)
3. Open bundle contents by selecting &#8220;Show Package Contents&#8221; from the right click menu options
4. Drag Root.strings into the en.lproj folder
5. Duplicate the en.lproj folder and rename to whatever language you [...]]]></description>
			<content:encoded><![CDATA[<p>For adding internationalization support to iPhone Settings.bundle, follow these steps:-<br />
1. Close the Xcode IDE<br />
2. Drag and duplicate the settings bundle onto the desktop (or wherever)<br />
3. Open bundle contents by selecting &#8220;Show Package Contents&#8221; from the right click menu options<br />
4. Drag Root.strings into the en.lproj folder<br />
5. Duplicate the en.lproj folder and rename to whatever language you  want (using 2-letter code. Eg: fr.lproj for French)<br />
6. Replace the original settings bundle with the new one.<br />
7. Open Xcode IDE and the new files and folders should be there<br />
This methods works fine in the simulator  and on my iPhone device.</p>
<div id="wherego_related"> </div>]]></content:encoded>
			<wfw:commentRss>http://www.macoscoders.com/2010/04/12/localizing-settings-bundle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Features In iPhone OS 4.0</title>
		<link>http://www.macoscoders.com/2010/04/09/new-features-in-iphone-os-4-0/</link>
		<comments>http://www.macoscoders.com/2010/04/09/new-features-in-iphone-os-4-0/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 07:25:47 +0000</pubDate>
		<dc:creator>Anish Kumar</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[iPhone Applications]]></category>
		<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[4.0]]></category>
		<category><![CDATA[IPhone]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[sdk]]></category>

		<guid isPermaLink="false">http://www.macoscoders.com/?p=398</guid>
		<description><![CDATA[iPhone OS 4 is the next generation of the world&#8217;s most innovative mobile  operating system. Its unique capabilities and new technologies will  change what you thought was possible on a mobile platform. With a rich set of over 1500 new APIs, iPhone SDK for iPhone OS 4  provides you with an amazing [...]]]></description>
			<content:encoded><![CDATA[<p>iPhone OS 4 is the next generation of the world&#8217;s most innovative mobile  operating system. Its unique capabilities and new technologies will  change what you thought was possible on a mobile platform. With a rich set of over 1500 new APIs, iPhone SDK for iPhone OS 4  provides you with an amazing range of technologies to enhance the  functionality of your iPhone and iPod touch apps. iPhone Developer  Program members can visit the iPhone Dev Center to download the iPhone  SDK 4 beta now.</p>
<div>
<h3 id="multitasking">Multitasking</h3>
<p>iPhone OS 4 delivers seven new multitasking services that allow  your apps to perform tasks in the background while preserving battery  life and performance. These multitasking services include:</p>
<ul>
<li><strong>Background audio</strong> &#8211; Allows your app to play audio  continuously. So customers can listen to your app while they surf the  web, play games, and more.</li>
<li><strong>Voice over IP</strong> &#8211; Your VoIP apps can now be even better.  Users can now receive VoIP calls and have conversations while using  another app. Your users can even receive calls when their phones are  locked in their pocket.</li>
<li><strong>Background location</strong> &#8211; Navigation apps can now continue  to guide users who are listening to their iPods, or using other apps.  iPhone OS 4 also provides a new and battery efficient way to monitor  location when users move between cell towers. This is a great way for  your social networking apps to keep track of users and their friends&#8217;  locations.</li>
<li><strong>Push notifications</strong> &#8211; Receive alerts from your remote  servers even when your app isn&#8217;t running.</li>
<li><strong>Local notifications</strong> &#8211; Your app can now alert users of  scheduled events and alarms in the background, no servers required.</li>
<li><strong>Task finishing</strong> &#8211; If your app is in mid-task when your  customer leaves it, the app can now keep running to finish the task.</li>
<li><strong>Fast app switching</strong> &#8211; All developers should take  advantage of this. This will allow users to leave your app and come  right back to where they were when they left &#8211; no more having to reload  the app.</li>
</ul>
<p><span id="more-398"></span></div>
<div>
<div>
<div><img src="http://devimages.apple.com/technologies/iphone/images/80x80_icon2.png" alt="iAd" width="80" height="80" /></div>
<div>
<h3 id="iAd">iAd</h3>
<p>Apple&#8217;s new mobile advertising platform, combines the emotion  of TV ads with the interactivity of web ads. When users click on mobile  ads they are almost always taken out of their app to a web browser,  which loads the advertiser&#8217;s webpage. Users must then navigate back to  their app, and it is often difficult or impossible to return to exactly  where they left. iAd solves this problem by displaying full-screen video  and interactive ad content without ever leaving the app, and letting  users return to their app anytime they choose. iPhone OS 4 lets  developers easily embed iAd opportunities within their apps, and the ads  are dynamically and wirelessly delivered to the device. Apple will sell  and serve the ads, and developers will receive 60 percent of iAd  revenue.</p>
<div>
<h3 id="gamecenter">Game Center</h3>
<p>The iPhone OS 4 beta software and SDK includes a developer  preview of the GameKit APIs that allows you to create apps that will  work with Game Center, Apple&#8217;s new social gaming network. Your users can  invite friends to play a game, start a multiplayer game through  matchmaking, track their achievements, and compare their high scores on a  leader board. The APIs are available to you now and Game Center will be  available to iPhone and iPod touch users later this year.</p>
<div>
<h4>Calendar Access</h4>
<p>Apps can now create and edit events directly in the Calendar  app with Event Kit. Create recurring events, set up start and end times  and assign them to any calendar on the device.</p>
<div>
<h4>In-App SMS</h4>
<p>Compose SMS messages from within apps, similar to the Mail  compose sheet added in iPhone SDK 3.0.</p></div>
<div>
<h4>Photo Library Access</h4>
<p>Applications now have direct access to user photos and videos  with the Media Library APIs.</p></div>
<p><!-- /.column.first --></p>
<div>
<div>
<h4>Video playback &amp; Capture</h4>
<p>You now have full programmatic control over video playback and  capture, using new APIs in the AV Foundation framework.</p></div>
<div>
<h4>Map Kit Improvements</h4>
<p>Mapping applications can now include overlays that can  identify regions on a map. Draw routes with annotations for customized  directions and other functionalities.</p></div>
<div>
<h4>Quick Look</h4>
<p>Applications can now present previews of documents, like  attachments in Mail, using the new Quick Look APIs.</p>
<div>
<h4>Accelerate</h4>
<p>Gain access to a cookbook of hundreds of industry-standard  mathematical functions optimized for iPhone and iPod touch, including  functions for performing vector and matrix factorizations, multiplying  arrays of large integers and computing simultaneous linear equations.</p>
<h3 id="tools">ew in Tools</h3>
<p>With a wealth of new tools and refinements, you&#8217;ll find that  developing amazing iPhone and iPod touch apps is easier than ever  before.</p>
<div>
<h4>Automated testing</h4>
<p>Automate the testing of your application by scripting touch  events using the new UIAutomation Instrument.</p>
<h4>Performance and power analysis</h4>
<p>Collect finely-grained performance data and track the power  usage of your application using the new Time Profiler and Energy  Diagnostics Instruments for iPhone OS.</p>
<div>
<h3 id="compatibility">iPhone OS 4 Compatibility</h3>
<p>iPhone OS 4 will work with iPhone 3G, iPhone 3GS, and the  second- and third-generation iPod touch this summer, and with iPad in  the fall. Not all features are compatible with all devices. For example,  multitasking is available only with iPhone 3GS and the third-generation  iPod touch (32GB and 64GB models from late 2009).</p>
<h1>What we didn&#8217;t get from iPhone OS 4</h1>
<div>
<p>Have to look over  the common wish list items that appear to be lacking from the iPhone OS announcement.</p>
<ul>
<li><strong>Mass storage mode</strong>: We would&#8217;ve liked to see an easier way  to just drag and drop files from our computer to the iPhone without  having to go through a third-party app.</li>
<li><strong>Tethering with AT&amp;T</strong>: Yes, we know this is already  possible with the current OS, but AT&amp;T in the U.S. have not gotten  onboard with it yet (tethering is currently available in other countries  like Canada and the U.K.). We were hoping we would hear more about it  at the event, but no dice there.</li>
<li><strong>Audio profiles</strong>: It would have been nice if the iPhone had  different audio profiles for different environments that you could  easily switch between.</li>
<li><strong>Flash support in Safari</strong>: Yeah, this was a pie-in-the-sky  wish, but we know a lot of you out there wanted it.</li>
<li><strong>FM radio</strong>: Another one that was highly unlikely, but again, we  know there are some who want it.</li>
<li><strong>Wi-Fi syncing</strong>: We would&#8217;ve really liked it if we could sync  or back up our information on the iPhone over Wi-Fi instead of having to  plug in our USB cable.</li>
<li><strong>Built-in photo editing</strong>: We know you can get third-party photo  editors on the iPhone but it would be nice to have a built-in one as  well.</li>
<li><strong>Printer support</strong>: This is a little more relevant to the iPad,  but we also wished iPhone OS 4 would provide some printer driver  support, which would be very helpful for printing out documents and  notes.</li>
<li><strong>Multiple notification bar</strong>: On Android, there is a handy pull  down area where you can see all of your recent notifications, like for  your new messages or new voicemails. It would be nice to see that on the  iPhone as well.</li>
</ul>
<p>Was there anything  that you wanted out of iPhone OS 4.0 but didn&#8217;t get? Sound off in the  comments section below.</p>
<h2>Apple&#8217;s iPhone OS 4.0: Afterthoughts</h2>
<p>iPhone OS 4.0 license  makes third-party developers agree that they&#8217;ll  write apps  using Apple&#8217;s own programming tools, not ones provided by  other  companies &#8212; apparently including Adobe&#8217;s upcoming Packager  for iPhone, which converts Flash  applications into iPhone programs.  I, as an avid Mac OS X developer love this clause in the agreement.  I have seen lots of companies that were into developing website proclaiming themselves as iPhone developers and taking away the value out of the iPhone. In any  event, this remains a developing  story and I always know Steve Jobs won&#8217;t let Apple developer down.</p></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="wherego_related"><h3>Readers who viewed this page, also viewed:</h3><ul><li><a href="http://www.macoscoders.com/2009/05/17/iphone-apple-push-notification-service-apns/" rel="bookmark" class="wherego_title">iPhone Apple Push Notification Service (APNS)</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/where-did-they-go-from-here/">Where did they go from here?</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.macoscoders.com/2010/04/09/new-features-in-iphone-os-4-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Warning: The Copy Bundle Resources build phase contains this target&#8217;s Info.plist file &#8216;Resources/Info.plist&#8217;.</title>
		<link>http://www.macoscoders.com/2010/03/30/warning-the-copy-bundle-resources-build-phase-contains-this-targets-info-plist-file-resourcesinfo-plist/</link>
		<comments>http://www.macoscoders.com/2010/03/30/warning-the-copy-bundle-resources-build-phase-contains-this-targets-info-plist-file-resourcesinfo-plist/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 07:37:50 +0000</pubDate>
		<dc:creator>Anish Kumar</dc:creator>
				<category><![CDATA[iPhone Applications]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[info.plist]]></category>
		<category><![CDATA[XCode]]></category>

		<guid isPermaLink="false">http://www.macoscoders.com/?p=395</guid>
		<description><![CDATA[Some times we would like to move the info.plist to other directories than the default project root directory. In such cases XCode would throw warning like &#8220;Warning: The Copy Bundle Resources build phase contains this target&#8217;s Info.plist file &#8216;Resources/Info.plist&#8217;.&#8221;
The Info.plist file belongs directly inside of the bundles Contents folder &#8212; that is to say, one [...]]]></description>
			<content:encoded><![CDATA[<p>Some times we would like to move the info.plist to other directories than the default project root directory. In such cases XCode would throw warning like &#8220;Warning: The Copy Bundle Resources build phase contains this target&#8217;s Info.plist file &#8216;Resources/Info.plist&#8217;.&#8221;</p>
<p>The Info.plist file belongs directly inside of the bundles Contents folder &#8212; that is to say, one level up from the Resources subdirectory. Thus copying Info.plist to that would serve little purpose, and might even be evidence of programmer oversight on something (as Xcode might think), hence the warning.  The Info.plist should not actually be a member of any target. The check boxes in the Get Info window of the info.plist should be unchecked and this warning can be avoided.</p>
<p>Hope this helps..!</p>
<div id="wherego_related"> </div>]]></content:encoded>
			<wfw:commentRss>http://www.macoscoders.com/2010/03/30/warning-the-copy-bundle-resources-build-phase-contains-this-targets-info-plist-file-resourcesinfo-plist/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Error: &#8220;CGGStackRestore: gstack underflow&#8221;</title>
		<link>http://www.macoscoders.com/2009/11/02/error-cggstackrestore-gstack-underflow/</link>
		<comments>http://www.macoscoders.com/2009/11/02/error-cggstackrestore-gstack-underflow/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 07:55:24 +0000</pubDate>
		<dc:creator>Anish Kumar</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[IPhone]]></category>
		<category><![CDATA[Leopard]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[XCode]]></category>
		<category><![CDATA[iPhone Applications]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[CGContextRestoreGState]]></category>
		<category><![CDATA[CGContextSaveGState]]></category>
		<category><![CDATA[CoreGraphics]]></category>

		<guid isPermaLink="false">http://www.macoscoders.com/?p=383</guid>
		<description><![CDATA[Today while I was working with some CoreGraphics API&#8217;s, I encountered a error which I was seeing it for the first time. CG for dumping an error &#8220;CGGStackRestore: gstack underflow&#8221; in the console everytime I invoked a method that was doing some CG based operations. Googling around I found that in CoreGraphics, you can save [...]]]></description>
			<content:encoded><![CDATA[<p>Today while I was working with some CoreGraphics API&#8217;s, I encountered a error which I was seeing it for the first time. CG for dumping an error &#8220;CGGStackRestore: gstack underflow&#8221; in the console everytime I invoked a method that was doing some CG based operations. Googling around I found that in CoreGraphics, you can save (CGContextSaveGState) and restore (CGContextRestoreGState) the graphics state. When the  state is saved, a copy is put on the graphics state&#8217;s &#8220;stack&#8221;, and when  it is restored, the top state on the stack is removed and used. If we  restore the state more times than we save it and then when we try to remove  and use the top item of the stack, the stack is empty, causing a stack  &#8220;underflow&#8221; error. So just make sure you have enough save-restore state methods called and it will fix the issue.</p>
<div class="wp-caption aligncenter" style="width: 765px"><img title="CGGStackRestore" src="http://www.macoscoders.com/images/CGGStackRestore.jpg" alt="CGGStackRestore" width="755" height="59" /><p class="wp-caption-text">CGGStackRestore</p></div>
<div id="wherego_related"> </div>]]></content:encoded>
			<wfw:commentRss>http://www.macoscoders.com/2009/11/02/error-cggstackrestore-gstack-underflow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coming Soon: Develop Native iPhone Application Using Actionscript</title>
		<link>http://www.macoscoders.com/2009/10/20/coming-soon-develop-native-iphone-application-using-actionscript/</link>
		<comments>http://www.macoscoders.com/2009/10/20/coming-soon-develop-native-iphone-application-using-actionscript/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 11:30:51 +0000</pubDate>
		<dc:creator>Anish Kumar</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Adobe Flex]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[IPhone]]></category>
		<category><![CDATA[Rumours]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[iPhone Applications]]></category>
		<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[iPhone Usage]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.macoscoders.com/?p=370</guid>
		<description><![CDATA[With Flash Professional CS5, we can now build applications for iPhone and iPod touch using ActionScript 3. These applications can be delivered to iPhone and iPod touch users through the Apple App Store. A public beta of Flash Professional CS5 with prerelease support for building applications for iPhone is planned for later this year. At [...]]]></description>
			<content:encoded><![CDATA[<p>With Flash Professional CS5, we can now build applications for iPhone and iPod touch using ActionScript 3. These applications can be delivered to iPhone and iPod touch users through the Apple App Store. A public beta of Flash Professional CS5 with prerelease support for building applications for iPhone is planned for later this year. At MAX 2009, Adobe showed a number of applications and games for iPhone that have been built using a prerelease version of Flash Professional CS5. The tooling update allows developers to use Flash technologies to develop content for iPhone and iPod touch. Developers can write new code or reuse existing web content to build applications for iPhone. Because the source code and assets are reusable across the Flash Platform runtimes,—Adobe AIR and Flash Player—it also gives developers a way to more easily target other mobile and desktop environments.</p>
<p><span id="more-370"></span></p>
<div class="wp-caption alignnone" style="width: 567px"><img title="Flash CS5: Native iPhone Application Development" src="http://www.macoscoders.com/images/flashcs5.jpg" alt="Flash CS5: Native iPhone Application Development" width="557" height="130" /><p class="wp-caption-text">Flash CS5: Native iPhone Application Development</p></div>
<p>The new support for iPhone applications in the Flash Platform tooling will not allow iPhone users to browse web content built with Flash technology on iPhone, but it may allow developers to repackage existing web content as applications for iPhone if they choose to do so.Flash Player uses a just-in-time compiler and virtual machine within a browser plug-in to play back content on websites. Those technologies are not allowed on the iPhone at this time, so a Flash Player for iPhone is not being made available today. Flash Professional CS5 will enable developers to build applications for iPhone that are installed as native applications. Users will be able to access the apps after downloading them from Apple’s App Store and installing them on iPhone or iPod touch. Developers can deliver applications built with Flash Platform tooling just like any other iPhone application. This will require the developer to be a member of the iPhone Developer Program and follow the program guidelines. iPhone applications built with Flash Platform tools are compiled into standard, native iPhone executables, just like any other iPhone applicatio. Applications can be built targeting iPhone OS 3.0 and later.</p>
<p><strong>Update:</strong> Apple has bowled out Adobe&#8217;s effort to get iPhone application development on Flash platform with introduction of new clause in its iPhone SDK 4.0 license agreement which makes developing iPhone application using tools other than from Apple as illegal. Check more details about whats new in iPhone SDK 4.0 and its implications at <a title="New Features: iPhone SDK 4.0 " href="http://www.macoscoders.com/2010/04/09/new-features-in-iphone-os-4-0/" target="_self">http://www.macoscoders.com/2010/04/09/new-features-in-iphone-os-4-0/</a></p>
<div id="wherego_related"><h3>Readers who viewed this page, also viewed:</h3><ul><li><a href="http://www.macoscoders.com/2010/04/09/new-features-in-iphone-os-4-0/" rel="bookmark" class="wherego_title">New Features In iPhone OS 4.0</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/where-did-they-go-from-here/">Where did they go from here?</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.macoscoders.com/2009/10/20/coming-soon-develop-native-iphone-application-using-actionscript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Best Practices For Creating Video For iPhone</title>
		<link>http://www.macoscoders.com/2009/08/26/best-practices-for-creating-video-for-iphone/</link>
		<comments>http://www.macoscoders.com/2009/08/26/best-practices-for-creating-video-for-iphone/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 07:42:09 +0000</pubDate>
		<dc:creator>Anish Kumar</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[IPhone]]></category>
		<category><![CDATA[iPhone Applications]]></category>
		<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[3G]]></category>
		<category><![CDATA[AAC]]></category>
		<category><![CDATA[edge]]></category>
		<category><![CDATA[h.264]]></category>
		<category><![CDATA[MPEG]]></category>
		<category><![CDATA[safari]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[wifi]]></category>

		<guid isPermaLink="false">http://www.macoscoders.com/?p=321</guid>
		<description><![CDATA[Safari supports audio and video viewing in a webpage on the desktop and iPhone OS. You can use audio and video HTML elements or use the embed element to use the native application for video playback. In either case, you need to ensure that the video you create is optimized for the platform and different [...]]]></description>
			<content:encoded><![CDATA[<p>Safari supports audio and video viewing in a webpage on the desktop and iPhone OS. You can use <code>audio</code> and <code>video</code> HTML elements or use the <code>embed</code> element to use the native application for video playback. In either case, you need to ensure that the video you create is optimized for the platform and different bandwidths.</p>
<p>iPhone OS streams movies and audio using HTTP over EDGE, 3G, and Wi-Fi networks. iPhone OS uses a native application to play back video even when video is embedded in your webpages. Video automatically expands to the size of the screen and rotates when the user changes orientation. The controls automatically hide when they are not in use and appear when the user taps the screen. This is the experience the user expects when viewing all video on iPhone OS.</p>
<p><span id="more-321"></span></p>
<p>Safari on iPhone OS supports a variety of rich media, including QuickTime movies<span class="content_text">.</span> Safari on iPhone OS does not support Flash so don’t bring up JavaScript alerts that ask users to download Flash. Also, don’t use JavaScript movie controls to play back video since iPhone OS supplies its own controls.</p>
<p>Safari on the desktop supports the same audio and video formats as Safari on iPhone OS. However, if you use the <code>audio</code> and <code>video</code> HTML elements on the desktop, you can customize the play back controls. See <em><a href="http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariJSRef/index.html#//apple_ref/doc/uid/TP40001482" target="_top">Safari DOM Extensions Reference</a></em> for more details on the <code>HTMLMediaElement</code> class.</p>
<p>Follow these guidelines to deliver the best web audio and video experience in Safari on any platform:</p>
<ul class="ul">
<li class="li">Follow current best practices for embedding movies in webpages as described in <span class="content_text"><a href="http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariWebContent/CreatingVideoforSafarioniPhone/CreatingVideoforSafarioniPhone.html#//apple_ref/doc/uid/TP40006514-SW7">“Sizing Movies Appropriately,”</a></span> <span class="content_text"><a href="http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariWebContent/CreatingVideoforSafarioniPhone/CreatingVideoforSafarioniPhone.html#//apple_ref/doc/uid/TP40006514-SW8">“Don’t Let the Bit Rate Stall Your Movie,”</a></span> and <span class="content_text"><a href="http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariWebContent/CreatingVideoforSafarioniPhone/CreatingVideoforSafarioniPhone.html#//apple_ref/doc/uid/TP40006514-SW9">“Using Supported Movie Standards.”</a></span></li>
<li class="li">Use QuickTime Pro to encode H.264/AAC at appropriate sizes and bit rates for EDGE, 3G, and Wi-Fi networks, as described in <span class="content_text"><a href="http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariWebContent/CreatingVideoforSafarioniPhone/CreatingVideoforSafarioniPhone.html#//apple_ref/doc/uid/TP40006514-SW4">“Encoding Video for Wi-Fi, 3G, and EDGE.”</a></span></li>
<li class="li">Use reference movies so that iPhone OS automatically streams the best version of your content for the current network connection, as described in <span class="content_text"><a href="http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariWebContent/CreatingVideoforSafarioniPhone/CreatingVideoforSafarioniPhone.html#//apple_ref/doc/uid/TP40006514-SW5">“Creating a Reference Movie.”</a></span></li>
<li class="li">Use poster JPEGs (not poster frames in a movie) to display a preview of your embedded movie in webpages, as described in <span class="content_text"><a href="http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariWebContent/CreatingVideoforSafarioniPhone/CreatingVideoforSafarioniPhone.html#//apple_ref/doc/uid/TP40006514-SW10">“Creating a Poster Image for Movies.”</a></span></li>
<li class="li">Make sure the HTTP servers hosting your media files support byte-range requests, as described in <span class="content_text"><a href="http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariWebContent/CreatingVideoforSafarioniPhone/CreatingVideoforSafarioniPhone.html#//apple_ref/doc/uid/TP40006514-SW6">“Configuring Your Server.”</a></span></li>
<li class="li">If your site has a custom media player, also provide direct links to the media files. iPhone OS users can follow these links to play those files directly.</li>
</ul>
<p><a title="Sizing Movies Appropriately" name="//apple_ref/doc/uid/TP40006514-SW7"></a></p>
<h2 class="jump section2">Sizing Movies Appropriately</h2>
<p>In landscape orientation on iPhone OS, the screen is 480 x 320 pixels. Users can easily switch the view mode between scaled-to-fit (letterboxed) and full-screen (centered and cropped). You should use a size that preserves the aspect ratio of your content and fits within a 480 x 360 rectangle. 480 x 360 is a good choice for 4:3 aspect ratio content and 480 x 270 is a good choice for widescreen content as it keeps the video sharp in full-screen view mode. You can also use 640 x 360 or anamorphic 640 x 480 with pixel aspect ratio tagging for widescreen content.</p>
<p><a title="Donâ€™t Let the Bit Rate Stall Your Movie" name="//apple_ref/doc/uid/TP40006514-SW8"></a></p>
<h2 class="jump section2">Don’t Let the Bit Rate Stall Your Movie</h2>
<p>When viewing media over the network, the bit rate makes a crucial difference to the playback experience. If the network cannot keep up with the media bit rate, playback stalls. Encode your media for iPhone OS as described in <span class="content_text"><a href="http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariWebContent/CreatingVideoforSafarioniPhone/CreatingVideoforSafarioniPhone.html#//apple_ref/doc/uid/TP40006514-SW4">“Encoding Video for Wi-Fi, 3G, and EDGE”</a></span> and use a reference movie as described in <span class="content_text"><a href="http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariWebContent/CreatingVideoforSafarioniPhone/CreatingVideoforSafarioniPhone.html#//apple_ref/doc/uid/TP40006514-SW5">“Creating a Reference Movie.”</a></span></p>
<p><a title="Using Supported Movie Standards" name="//apple_ref/doc/uid/TP40006514-SW9"></a></p>
<h2 class="jump section2">Using Supported Movie Standards</h2>
<p>The following compression standards are supported:</p>
<ul class="ul">
<li class="li">H.264 Baseline Profile Level 3.0 video, up to 640 x 480 at 30 fps. Note that B frames are not supported in the Baseline profile.</li>
<li class="li">MPEG-4 Part 2 video (Simple Profile)</li>
<li class="li">AAC-LC audio, up to 48 kHz</li>
</ul>
<p>Movie files with the extensions <code>.mov</code>, <code>.mp4</code>, <code>.m4v</code>, and <code>.3gp</code> are supported.</p>
<p>Any movies or audio files that can play on iPod play correctly on iPhone.</p>
<p>If you export your movies using QuickTime Pro 7.2, as described in <span class="content_text"><a href="http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariWebContent/CreatingVideoforSafarioniPhone/CreatingVideoforSafarioniPhone.html#//apple_ref/doc/uid/TP40006514-SW4">“Encoding Video for Wi-Fi, 3G, and EDGE,”</a></span> then you can be sure that they are optimized to play on iPhone OS.</p>
<p><a title="Encoding Video for Wi-Fi, 3G, and EDGE" name="//apple_ref/doc/uid/TP40006514-SW4"></a></p>
<h2 class="jump section2">Encoding Video for Wi-Fi, 3G, and EDGE</h2>
<p>Because users may be connected to the Internet via wired or wireless technology, using either Wi-Fi, 3G, or EDGE on iPhone OS, you need to provide alternate media for these different connection speeds. You can use QuickTime Pro, the QuickTime API, or any Apple applications that provide iPhone OS exporters to encode your video for Wi-Fi, 3G, and EDGE. This section contains specific instructions for exporting video using QuickTime Pro.</p>
<p>Follow these steps to export video using QuickTime Pro 7.2.1 and later:</p>
<ol class="ol">
<li class="li">Open your movie using QuickTime Player Pro.</li>
<li class="li">Choose File &gt; Export for Web.A dialog appears.</li>
<li class="li">Enter the file name prefix, location of your export, and set of versions to export as shown in <span class="content_text">Figure 8-1</span>.
<div class="item_figure"><a title="Figure 8-1Export movie panel" name="//apple_ref/doc/uid/TP40006514-SW14"></a><strong>Figure 8-1 </strong>Export movie panel</p>
<p><img class="alignleft" src="http://www.macoscoders.com/images/export_iphone_dialog.jpg" alt="Export movie panel" width="289" height="284" /></div>
</li>
<li class="li">Click Export.QuickTime Player Pro saves these versions of your QuickTime movie, along with a reference movie, poster image, and <code>ReadMe.html</code> file to the specified location. See the <code>ReadMe.html</code> file for instructions on embedding the generated movie in your webpage, including sample HTML.</li>
</ol>
<p><a title="Creating a Reference Movie" name="//apple_ref/doc/uid/TP40006514-SW5"></a></p>
<h2 class="jump section2">Creating a Reference Movie</h2>
<p>A reference movie contains a list of movie URLs, each of which has a list of tests, as show in <span class="content_text">Figure 8-2</span>. When opening the reference movie, a playback device or computer chooses one of the movie URLs by finding the last one that passes all its tests. Tests can check the capabilities of the device or computer and the speed of the network connection.</p>
<div class="figure"><a title="Figure 8-2Reference movie components" name="//apple_ref/doc/uid/TP40006514-SW3"></a><strong>Figure 8-2 </strong>Reference movie components</p>
<p><img src="http://www.macoscoders.com/images/qt_ref_movie_options.jpg" alt="Reference movie components" width="286" height="142" /></div>
<p>If you use QuickTime Pro 7.2.1 or later to export your movies for iPhone OS, as described in <span class="content_text"><a href="http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariWebContent/CreatingVideoforSafarioniPhone/CreatingVideoforSafarioniPhone.html#//apple_ref/doc/uid/TP40006514-SW4">“Encoding Video for Wi-Fi, 3G, and EDGE,”</a></span> then you already have a reference movie. Otherwise, you can use the MakeRefMovie tool to create reference movies. You can download the tool from:</p>
<ul class="simple">
<li><span class="content_text"><a class="browserLink" href="http://developer.apple.com/quicktime/quicktimeintro/tools">http://developer.apple.com/quicktime/quicktimeintro/tools</a></span></li>
</ul>
<p>Also, refer to the <em><a href="http://developer.apple.com/safari/library/samplecode/makeiPhoneRefMovie/index.html#//apple_ref/doc/uid/DTS10004417" target="_top">MakeiPhoneRefMovie</a></em> sample for a command-line tool that creates reference movies.</p>
<p>For more details on reference movies and instructions on how to set them up see “Applications and Examples” in <em><a href="http://developer.apple.com/safari/library/documentation/QuickTime/Conceptual/QTScripting_HTML/index.html#//apple_ref/doc/uid/TP40001525" target="_top">HTML Scripting Guide for QuickTime</a></em>.</p>
<p><a title="Creating a Poster Image for Movies" name="//apple_ref/doc/uid/TP40006514-SW10"></a></p>
<h2 class="jump section2">Creating a Poster Image for Movies</h2>
<p>The video is not decoded until the user enters movie playback mode. Consequently, when displaying a webpage with video, users may see a gray rectangle with a QuickTime logo until they tap the Play button. Therefore, use a poster JPEG as a preview of your movie. If you use QuickTime Pro 7.2.1 or later to export your movies, as described in <span class="content_text"><a href="http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariWebContent/CreatingVideoforSafarioniPhone/CreatingVideoforSafarioniPhone.html#//apple_ref/doc/uid/TP40006514-SW4">“Encoding Video for Wi-Fi, 3G, and EDGE,”</a></span> then a poster image is already created for you. Otherwise, follow these instructions to set a poster image.</p>
<p>If you are using the <code>&lt;video&gt;</code> element, specify a poster image by setting the <code>poster</code> attribute as follows:</p>
<div class="codesample clear">
<table border="0">
<tbody>
<tr>
<td scope="row">
<pre>&lt;video poster="poster.jpg" src="movie.m4v" ...&gt; &lt;/video&gt;</pre>
</td>
</tr>
</tbody>
</table>
</div>
<p>If you are using an <code>&lt;embed&gt;</code> HTML element, specify a poster image by setting the image for <code>src</code>, the movie for <code>href</code>, the media MIME type for <code>type</code>, and <code>myself</code> as the <code>target</code>:</p>
<div class="codesample clear">
<table border="0">
<tbody>
<tr>
<td scope="row">
<pre>&lt;embed src="poster.jpg" href="movie.m4v" type="video/x-m4v" target="myself" scale="1" ...&gt;</pre>
</td>
</tr>
</tbody>
</table>
</div>
<p>Make similar changes if you are using the <code>&lt;object&gt;</code> HTML element or JavaScript to embed movies in your webpage.</p>
<p>On the desktop, this image is displayed until the user clicks, at which time the movie is substituted.</p>
<p>For more information on including QuickTime Movies in webpages, see the tutorial <span class="content_text"><a class="urlLink" href="http://www.apple.com/quicktime/tutorials/embed.html" target="_blank">Including QuickTime In A Web Page</a></span>.</p>
<p><a title="Configuring Your Server" name="//apple_ref/doc/uid/TP40006514-SW6"></a></p>
<h2 class="jump section2">Configuring Your Server</h2>
<p>HTTP servers hosting media files for iPhone OS must support byte-range requests, which iPhone OS uses to perform random access in media playback. (Byte-range support is also known as content-range or partial-range support.) Most, but not all, HTTP 1.1 servers already support byte-range requests.</p>
<p>If you are not sure whether your media server supports byte-range requests, you can open the Terminal application in Mac OS X and use the <code>curl</code> command-line tool to download a short segment from a file on the server:</p>
<div class="codesample clear">
<table border="0">
<tbody>
<tr>
<td scope="row">
<pre>curl --range 0-99 http://example.com/test.mov -o /dev/null</pre>
</td>
</tr>
</tbody>
</table>
</div>
<p>If the tool reports that it downloaded 100 bytes, the media server correctly handled the byte-range request. If it downloads the entire file, you may need to update the media server. For more information on <code>curl</code>, see <em><!--a target="_top" -->Mac OS X Man Pages<!--/a--></em>.</p>
<p>Ensure that your HTTP server sends the correct MIME types for the movie filename extensions shown in <span class="content_text">Table 8-1</span>.</p>
<p><a title="Table 8-1File name extensions for MIME types" name="//apple_ref/doc/uid/TP40006514-SW2"></a></p>
<div class="tableholder">
<table class="graybox" border="0" cellspacing="0" cellpadding="5">
<caption class="tablecaption"><strong>Table 8-1 </strong>File name extensions for MIME types</caption>
<tbody>
<tr>
<th style="font-weight: bold;" align="left" scope="col">Extensions</th>
<th style="font-weight: bold;" align="left" scope="col">MIME type</th>
</tr>
<tr>
<td scope="row"><code>.mov</code></td>
<td>video/quicktime</td>
</tr>
<tr>
<td scope="row"><code>.mp4</code></td>
<td>video/mp4</td>
</tr>
<tr>
<td scope="row"><code>.m4v</code></td>
<td>video/x-m4v</td>
</tr>
<tr>
<td scope="row"><code>.3gp</code></td>
<td>video/3gpp</td>
</tr>
</tbody>
</table>
</div>
<p>Be aware that iPhone OS supports movies larger than 2 GB. However, some older web servers are not able to serve files this large. Apache 2 supports downloading files larger than 2 GB.</p>
<div id="wherego_related"><h3>Readers who viewed this page, also viewed:</h3><ul><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/where-did-they-go-from-here/">Where did they go from here?</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.macoscoders.com/2009/08/26/best-practices-for-creating-video-for-iphone/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Customising UITableView: A nice article</title>
		<link>http://www.macoscoders.com/2009/06/25/customising-uitableview-a-nice-article/</link>
		<comments>http://www.macoscoders.com/2009/06/25/customising-uitableview-a-nice-article/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 10:58:05 +0000</pubDate>
		<dc:creator>Anish Kumar</dc:creator>
				<category><![CDATA[iPhone Applications]]></category>
		<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[UITableView]]></category>

		<guid isPermaLink="false">http://www.macoscoders.com/?p=294</guid>
		<description><![CDATA[One of my colleague found this nice article on the web which explains things we need to do and not to do to customize a UITableView and make it look great than a plain dump table.
http://cocoawithlove.com/2009/04/easy-custom-uitableview-drawing.html
Readers who viewed this page, also viewed:Powered by Where did they go from here?]]></description>
			<content:encoded><![CDATA[<p>One of my colleague found this nice article on the web which explains things we need to do and not to do to customize a UITableView and make it look great than a plain dump table.</p>
<p>http://cocoawithlove.com/2009/04/easy-custom-uitableview-drawing.html</p>
<div id="wherego_related"><h3>Readers who viewed this page, also viewed:</h3><ul><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/where-did-they-go-from-here/">Where did they go from here?</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.macoscoders.com/2009/06/25/customising-uitableview-a-nice-article/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Error: &#8220;no valid &#8216;aps-environment&#8217; entitlement string found for application&#8221;</title>
		<link>http://www.macoscoders.com/2009/06/23/error-no-valid-aps-environment-entitlement-string-found-for-application/</link>
		<comments>http://www.macoscoders.com/2009/06/23/error-no-valid-aps-environment-entitlement-string-found-for-application/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 08:53:58 +0000</pubDate>
		<dc:creator>Anish Kumar</dc:creator>
				<category><![CDATA[iPhone Applications]]></category>
		<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[APNS]]></category>
		<category><![CDATA[aps-environment]]></category>
		<category><![CDATA[entitlement string]]></category>
		<category><![CDATA[NSCocoaErrorDomain]]></category>

		<guid isPermaLink="false">http://www.macoscoders.com/?p=288</guid>
		<description><![CDATA[I got this error while building an iPhone application that is going to use APNS. I am still trying to figure out what is causing this problem. A more detailed error message is here:-
"Error Domain=NSCocoaErrorDomain Code=3000 UserInfo=0x113e80 "no valid 'aps-environment' entitlement string found for application"
/pre>
Readers who viewed this page, also viewed:App Icons Messed Up With [...]]]></description>
			<content:encoded><![CDATA[<p>I got this error while building an iPhone application that is going to use APNS. I am still trying to figure out what is causing this problem. A more detailed error message is here:-</p>
<pre><strong>"Error Domain=NSCocoaErrorDomain Code=3000 UserInfo=0x113e80 "no valid 'aps-environment' entitlement string found for application"</strong>

<div class="wp-caption alignleft" style="width: 381px"><img class="  " title="APNS Error" src="http://www.macoscoders.com/images/APNS_Error.jpg" alt="APNS Error" width="371" height="88" /><p class="wp-caption-text">APNS Error</p></div></pre>
<div id="wherego_related"><h3>Readers who viewed this page, also viewed:</h3><ul><li><a href="http://www.macoscoders.com/2009/05/13/app-icons-messed-up-with-iphone-os-30-beta-5/" rel="bookmark" class="wherego_title">App Icons Messed Up With iPhone OS 3.0 Beta 5</a></li><li><a href="http://www.macoscoders.com/2009/06/08/error-the-executable-was-signed-with-invalid-entitlements/" rel="bookmark" class="wherego_title">Error: The executable was signed with invalid entitlements</a></li><li><a href="http://www.macoscoders.com/2009/05/17/iphone-apple-push-notification-service-apns/" rel="bookmark" class="wherego_title">iPhone Apple Push Notification Service (APNS)</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/where-did-they-go-from-here/">Where did they go from here?</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.macoscoders.com/2009/06/23/error-no-valid-aps-environment-entitlement-string-found-for-application/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>XCode: Could Not Support Development</title>
		<link>http://www.macoscoders.com/2009/06/20/xcode-could-not-support-development/</link>
		<comments>http://www.macoscoders.com/2009/06/20/xcode-could-not-support-development/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 18:33:56 +0000</pubDate>
		<dc:creator>Anish Kumar</dc:creator>
				<category><![CDATA[iPhone Applications]]></category>
		<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[IPhone]]></category>
		<category><![CDATA[iTunes]]></category>
		<category><![CDATA[Organizer]]></category>
		<category><![CDATA[XCode]]></category>

		<guid isPermaLink="false">http://www.macoscoders.com/?p=279</guid>
		<description><![CDATA[Today  when I started my work on an iPhone project, my XCode failed to mount my iPhone. The XCode organizer was showing an orange dot next to it instead of the usual green one. Organizer complained &#8220;Could Not Support Development&#8221;. I tried restarting my XCode, launched iTunes but in vain. iTunes was able to mount [...]]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignleft" style="width: 335px"><img title="XCode: Could Not Support Development" src="http://www.macoscoders.com/images/Could_Not_Support_Development.jpg" alt="XCode: Could Not Support Development" width="325" height="125" /><p class="wp-caption-text">XCode: Could Not Support Development</p></div>
<p>Today  when I started my work on an iPhone project, my XCode failed to mount my iPhone. The XCode organizer was showing an orange dot next to it instead of the usual green one. Organizer complained &#8220;Could Not Support Development&#8221;. I tried restarting my XCode, launched iTunes but in vain. iTunes was able to mount my iPhone but XCode simply failed and I was not able to test my app&#8217;s on my phone. <span id="more-279"></span>Finally I restarted my iPhone and tried again. Bingooo..! it started working again. My iPhone was running the latest iPhone OS 3.0 GM developers build. See left for the screenshot of the error message that I got.</p>
<div id="wherego_related"><h3>Readers who viewed this page, also viewed:</h3><ul><li><a href="http://www.macoscoders.com/2009/06/08/error-the-executable-was-signed-with-invalid-entitlements/" rel="bookmark" class="wherego_title">Error: The executable was signed with invalid entitlements</a></li><li><a href="http://www.macoscoders.com/2009/05/13/app-icons-messed-up-with-iphone-os-30-beta-5/" rel="bookmark" class="wherego_title">App Icons Messed Up With iPhone OS 3.0 Beta 5</a></li><li><a href="http://www.macoscoders.com/2009/06/11/add-background-image-to-uiview/" rel="bookmark" class="wherego_title">Add Background Image To UIView</a></li><li><a href="http://www.macoscoders.com/2009/05/17/iphone-apple-push-notification-service-apns/" rel="bookmark" class="wherego_title">iPhone Apple Push Notification Service (APNS)</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/where-did-they-go-from-here/">Where did they go from here?</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.macoscoders.com/2009/06/20/xcode-could-not-support-development/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Error Starting Executable</title>
		<link>http://www.macoscoders.com/2009/06/18/error-starting-executable/</link>
		<comments>http://www.macoscoders.com/2009/06/18/error-starting-executable/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 08:06:40 +0000</pubDate>
		<dc:creator>Anish Kumar</dc:creator>
				<category><![CDATA[IPhone]]></category>
		<category><![CDATA[iPhone Applications]]></category>
		<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[Organizer]]></category>
		<category><![CDATA[XCode]]></category>

		<guid isPermaLink="false">http://www.macoscoders.com/?p=275</guid>
		<description><![CDATA[Quite a few times in our iPhone application development cycle we would encounter XCode error &#8220;Error Starting Executable &#8211; No provisioned iPhone OS device is connected.&#8221; even when we know the device is connected to the machine.   This error occurs when the connected device is not configured in the XCode-&#62;Organizer. Organizer would fail to [...]]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignleft" style="width: 263px"><img title="Error Starting Executable" src="http://www.macoscoders.com/images/Error_Starting_Executable.jpg" alt="Error Starting Executable" width="253" height="80" /><p class="wp-caption-text">Error Starting Executable</p></div>
<p>Quite a few times in our iPhone application development cycle we would encounter XCode error &#8220;Error Starting Executable &#8211; No provisioned iPhone OS device is connected.&#8221; even when we know the device is connected to the machine.   This error occurs when the connected device is not configured in the XCode-&gt;Organizer. Organizer would fail to mount the device as the version of XCode installed on the developer machine may not support the version of iPhone OS installed on the device.</p>
<p><span id="more-275"></span>If you select the device in the Organizer, then XCode would list you the supported iPhone OS versions as well as the OS Version of the device. (An organe dot aganist the device in Organizer indicates it has not been mounted properly.)</p>
<div class="wp-caption alignleft" style="width: 323px"><img title="iPod_Unmounted_In_Organizer" src="http://www.macoscoders.com/images/iPod_Unmounted_In_Organizer.jpg" alt="iPod_Unmounted_In_Organizer" width="313" height="49" /><p class="wp-caption-text">iPod_Unmounted_In_Organizer</p></div>
<div id="wherego_related"><h3>Readers who viewed this page, also viewed:</h3><ul><li><a href="http://www.macoscoders.com/2009/05/17/iphone-apple-push-notification-service-apns/" rel="bookmark" class="wherego_title">iPhone Apple Push Notification Service (APNS)</a></li><li><a href="http://www.macoscoders.com/2009/06/08/error-the-executable-was-signed-with-invalid-entitlements/" rel="bookmark" class="wherego_title">Error: The executable was signed with invalid entitlements</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/where-did-they-go-from-here/">Where did they go from here?</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.macoscoders.com/2009/06/18/error-starting-executable/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Add Background Image To UIView</title>
		<link>http://www.macoscoders.com/2009/06/11/add-background-image-to-uiview/</link>
		<comments>http://www.macoscoders.com/2009/06/11/add-background-image-to-uiview/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 16:20:43 +0000</pubDate>
		<dc:creator>Anish Kumar</dc:creator>
				<category><![CDATA[iPhone Applications]]></category>
		<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[backgroundColor]]></category>
		<category><![CDATA[imageNamed]]></category>
		<category><![CDATA[initWithPatternImage]]></category>
		<category><![CDATA[UIColor]]></category>
		<category><![CDATA[UIImage]]></category>
		<category><![CDATA[UIView]]></category>
		<category><![CDATA[viewDidLoad]]></category>

		<guid isPermaLink="false">http://www.macoscoders.com/?p=262</guid>
		<description><![CDATA[If you ever need to add a image as background for an UIView then do it like this (Make sure the image is in your app&#8217;s resource bundle):-
- (void)viewDidLoad
{
    self.view.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"MyBackground.png"]];
}
Readers who viewed this page, also viewed:How to set badge value of an TabBar ItemiPhone Apple Push Notification [...]]]></description>
			<content:encoded><![CDATA[<p>If you ever need to add a image as background for an UIView then do it like this (Make sure the image is in your app&#8217;s resource bundle):-</p>
<pre style="padding-left: 30px;">- (void)viewDidLoad
{
    self.view.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"MyBackground.png"]];
}</pre>
<div id="wherego_related"><h3>Readers who viewed this page, also viewed:</h3><ul><li><a href="http://www.macoscoders.com/2009/05/19/how-to-set-badge-value-of-an-tabbar-item/" rel="bookmark" class="wherego_title">How to set badge value of an TabBar Item</a></li><li><a href="http://www.macoscoders.com/2009/05/17/iphone-apple-push-notification-service-apns/" rel="bookmark" class="wherego_title">iPhone Apple Push Notification Service (APNS)</a></li><li><a href="http://www.macoscoders.com/2009/06/23/error-no-valid-aps-environment-entitlement-string-found-for-application/" rel="bookmark" class="wherego_title">Error: &#8220;no valid &#8216;aps-environment&#8217; entitlement string found for application&#8221;</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/where-did-they-go-from-here/">Where did they go from here?</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.macoscoders.com/2009/06/11/add-background-image-to-uiview/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>My First Post Using Wordpress For iPhone</title>
		<link>http://www.macoscoders.com/2009/06/08/my-first-post-using-wordpress-for-iphone/</link>
		<comments>http://www.macoscoders.com/2009/06/08/my-first-post-using-wordpress-for-iphone/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 17:40:24 +0000</pubDate>
		<dc:creator>Anish Kumar</dc:creator>
				<category><![CDATA[iPhone Applications]]></category>
		<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[IPhone]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.macoscoders.com/2009/06/08/my-first-post-using-wordpress-for-iphone/</guid>
		<description><![CDATA[This is my first post using iPhone 3.0 Wordpress application. This is awesome cool in that now I can blog when I am travelling. I will write more about this app as I begin to use more of it.
the first feedback would be I am missing all the formatting options that I take for granted [...]]]></description>
			<content:encoded><![CDATA[<p>This is my first post using iPhone 3.0 Wordpress application. This is awesome cool in that now I can blog when I am travelling. I will write more about this app as I begin to use more of it.</p>
<p>the first feedback would be I am missing all the formatting options that I take for granted on desktop version of wordpress. </p>
<div id="wherego_related"> </div>]]></content:encoded>
			<wfw:commentRss>http://www.macoscoders.com/2009/06/08/my-first-post-using-wordpress-for-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to set badge value of an TabBar Item</title>
		<link>http://www.macoscoders.com/2009/05/19/how-to-set-badge-value-of-an-tabbar-item/</link>
		<comments>http://www.macoscoders.com/2009/05/19/how-to-set-badge-value-of-an-tabbar-item/#comments</comments>
		<pubDate>Tue, 19 May 2009 16:44:32 +0000</pubDate>
		<dc:creator>Anish Kumar</dc:creator>
				<category><![CDATA[iPhone Applications]]></category>
		<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[badgeValue]]></category>
		<category><![CDATA[selectedViewController]]></category>
		<category><![CDATA[tabBarItem]]></category>
		<category><![CDATA[UITabBarController]]></category>

		<guid isPermaLink="false">http://www.macoscoders.com/?p=200</guid>
		<description><![CDATA[Many iPhone projects would require setting some numeric value on tabBarItem called badge. We can set the badge value for a tabBarItem by:-
 
//__tabBarController  is a outlet to our UITabBarController

__tabBarController.selectedViewController.tabBarItem.badgeValue = @&#8221;1&#8243;;
 
 
The badge value expects an string and it should be an integer. The maximum width of the badge is around 58 pixels [...]]]></description>
			<content:encoded><![CDATA[<p>Many iPhone projects would require setting some numeric value on tabBarItem called badge. We can set the badge value for a tabBarItem by:-</p>
<address style="padding-left: 30px;"> </address>
<div class="wp-caption alignnone" style="width: 238px"><img title="UITabBarItem With Badges" src="http://www.macoscoders.com/images/TabBar_With_Badges.jpg" alt="Fig: UITabBarItem With Badges" width="228" height="62" /><p class="wp-caption-text">Fig: UITabBarItem With Badges</p></div>
<address style="padding-left: 30px;">//__tabBarController  is a outlet to our UITabBarController<br />
</address>
<address style="padding-left: 30px;">__tabBarController.selectedViewController.tabBarItem.badgeValue = @&#8221;1&#8243;;</address>
<address style="padding-left: 30px;"> </address>
<address style="padding-left: 30px;"> </address>
<address>The badge value expects an string and it should be an integer. The maximum width of the badge is around 58 pixels in which approximately 7 to 9 digits fit in depending on the digits being displayed.</address>
<div class="wp-caption alignleft" style="width: 248px"><img title="Too Many Digits In Badge" src="http://www.macoscoders.com/images/Too_Many_Digits_In_Badge.jpg" alt="Too Many Digits In Badge" width="238" height="47" /><p class="wp-caption-text">Too Many Digits In Badge</p></div>
<div id="wherego_related"><h3>Readers who viewed this page, also viewed:</h3><ul><li><a href="http://www.macoscoders.com/2010/04/13/set-application-badge-number/" rel="bookmark" class="wherego_title">Set Application Badge Number</a></li><li><a href="http://www.macoscoders.com/2009/05/17/iphone-apple-push-notification-service-apns/" rel="bookmark" class="wherego_title">iPhone Apple Push Notification Service (APNS)</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/where-did-they-go-from-here/">Where did they go from here?</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.macoscoders.com/2009/05/19/how-to-set-badge-value-of-an-tabbar-item/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>iPhone Apple Push Notification Service (APNS)</title>
		<link>http://www.macoscoders.com/2009/05/17/iphone-apple-push-notification-service-apns/</link>
		<comments>http://www.macoscoders.com/2009/05/17/iphone-apple-push-notification-service-apns/#comments</comments>
		<pubDate>Sun, 17 May 2009 18:44:03 +0000</pubDate>
		<dc:creator>Anish Kumar</dc:creator>
				<category><![CDATA[iPhone Applications]]></category>
		<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[APNS]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[push notification service]]></category>

		<guid isPermaLink="false">http://www.macoscoders.com/?p=191</guid>
		<description><![CDATA[Apple&#8217;s has announced a push notification service for the iPhone that it&#8217;ll provide to all developers. It&#8217;ll maintain a persistent IP connection to the phone and let a 3rd party server ping Apple&#8217;s notification service in order to push out notifications to users device, which can be in the form of badges, sounds or custom [...]]]></description>
			<content:encoded><![CDATA[<p>Apple&#8217;s has announced a push notification service for the iPhone that it&#8217;ll provide to all developers. It&#8217;ll maintain a persistent IP connection to the phone and let a 3rd party server ping Apple&#8217;s notification service in order to push out notifications to users device, which can be in the form of badges, sounds or custom textual alerts. According to Apple, the service will preserve battery life and maintain performance, not to mention work over WiFi or cellular.</p>
<h3><span id="more-191"></span>What is Push Notification and How does it work?</h3>
<p>Let’s say you’re running a 3rd party IM (instant message) client on iPhone 2.0. When you exit the app, you no longer know if you’re receiving more messages. (Sure, there are work around over SMS and Email, but the app itself is dead to you).</p>
<p>With Apple’s Push Notification Service on iPhone OS 3.0, anytime someone sends you a new IM, an alert can be sent from the IM  developer’s servers (yes, they’ll have to keep a session open for you on their end), to Apple’s Push Notification Service (APNS) servers.</p>
<p>Apple’s PNS server will have a persistent TCP/IP connection to your iPhone . Once Apple PNS gets the alert from the developer server, APNS will “PUSH” it out to your iPhone 3.0.</p>
<p>Apple PNS currently supports 3 kinds of alerts: badges with a number (like Mail uses to show you unread messages), custom sounds (like a beep or bell or anything already built into the app by the developer), or modal message boxes (like the kind that pop up to tell you your battery is at 20%).</p>
<p>Apple isn’t making any promises on up-time for the service, and any new service will have delays and downtime.</p>
<p>What APNS doesn’t solve, however, is the lack of good notifications on the iPhone, and applications that require multitasking for something other than notification (i.e. streaming internet radio apps).</p>
<p>Imagine if 10 apps try to push out 10 alerts at the same time, how will Apple manage those on your device? Will you have to “cancel” or “accept” 50 modal message dialogs, or be hit by a cacophony of 30 random sounds? We don’t know yet, but hopefully Apple will address this.</p>
<h2>Generate APNS SSL Certificate</h2>
<p>To get started with APNS we need to generate an certificate unique to each applications which will support APNS. We need to log into our iPhone developer portal with &#8220;Team Agent&#8221; access.  Only users with &#8220;Team Agent&#8221; access can do the below mentioned process. The iPhone developer portal with &#8220;Team Agent &#8221; has a detailed steps to generate an APNS certificate. You should be able to see the screen shown below in the portal to start creating your APNS certificate. Follow the steps mentioned below:-</p>
<div class="wp-caption alignleft" style="width: 250px"><img title="APNS Development Certificate" src="http://www.macoscoders.com/images/apns_development_certificate_request.jpg" alt="APNS Development Certificate" width="240" height="218" /><p class="wp-caption-text">Fig 1: APNS Development Certificate</p></div>
<p>(1) You need to create an App ID without <span style="font-weight: bold;">.*</span> in the iPhone developer Portal. An App ID without .* means its unique and works only for a single application</p>
<p>(2) Generate a certificate signing request from your Mac&#8217;s keychain (You should be an Team Agent to have access to the wizard shown in Figure 1) as shown in figure 2 and <span style="font-weight: bold;">save to disk<br />
</span></p>
<p>(3) Upload the CertificateSigningRequest.certSigningRequest to the Program Portal</p>
<p>(4) Wait for the generation of cert (about 1 min). Download the certificate (aps_developer_identity.cer) from the Program Portal</p>
<p>(5) Keep (or rename them if you want) these 2 files (steps 2 and 4) in a safe place. You might need the CertificateSigningRequest.certSigningRequest file to request a production cert in the future or renew it again.</p>
<p>(6) Suppose you have imported the aps_developer_identity.cer to the keychain.  Then you have to export these new cert and the <span style="font-weight: bold;">private key</span> of this cert (not the public key) and saved as .p12 files.</p>
<p>(7) Then you use these commands to generate the cert and key in Mac&#8217;s Terminal for PEM format (Privacy Enhanced Mail Security Certificate)<br />
<code><br />
openssl pkcs12 -clcerts -nokeys -out cert.pem -in cert.p12<br />
openssl pkcs12 -nocerts -out key.pem -in key.p12<br />
</code></p>
<p>(8) The cert.pem and key.pem files will be used by your own program communicating with APNS.</p>
<p>(9) If you want to remove the passphase of private key in key.pem, do this</p>
<p>openssl rsa -in key.pem -out key.unencrypted.pem</p>
<p>Then combine the certificate and key<br />
<code><br />
cat cert.pem key.unencrypted.pem &gt; ck.pem<br />
</code></p>
<p>But please set the file permission of this unencrypted key by using <span style="font-style: italic;">chmod 400</span> and is only readable by root in a sever configuration.</p>
<p>(10) The testing APNS is at ssl://gateway.sandbox.push.apple.com:2195</p>
<div class="wp-caption alignleft" style="width: 519px"><img title="Request Certificate From Keychain Access" src="http://www.macoscoders.com/images/Request_Certificate_From_Keychain_Access.jpg" alt="Request Certificate From Keychain Access" width="509" height="224" /><p class="wp-caption-text">Fig 2: Request Certificate From Keychain Access</p></div>
<p>(11) For the source codes to push payload message to the APNS, you can find them in the Developer Forum. This is the one that I used, for php. Run this (after obtaining the device token from the testing device and with iPhone Client program setup)<br />
<code>php -f apns.php "My Message" 2</code></p>
<p>or if you put this php script and the ck.pem in a local web server, you can use this to test<br />
<code>http://127.0.0.1/apns/apns.php?message=Hello%20from%20macoscoders&amp;badge=2&amp;sound=received5.caf</code></p>
<p><strong>apns.php</strong></p>
<dl class="codebox">
<dd style="padding-left: 60px;"><code><br />
</code></p>
<address><code>&lt;?php</code></address>
<address><code>$deviceToken = '02da851dXXXXXXXXb4f2b5bfXXXXXXXXce198270XXXXXXXX0d3dac72bc87cd60';  // masked for security reason</code></address>
<address><code>// Passphrase for the private key (ck.pem file)</code></address>
<address><code>// $pass = ''; </code></address>
<address></address>
<address><code>// Get the parameters from http get or from command line</code></address>
<address><code>$message = $_GET['message'] or $message = $argv[1] or $message = 'Message received from javacom'; </code></address>
<address><code>$badge = (int)$_GET['badge'] or $badge = (int)$argv[2]; </code></address>
<address><code>$sound = $_GET['sound'] or $sound = $argv[3]; </code></address>
<address></address>
<address><code>// Construct the notification payload</code></address>
<address><code>$body = array();</code></address>
<address><code>$body['aps'] = array('alert' =&gt; $message);</code></address>
<address><code>if ($badge)</code></address>
<address><code> $body['aps']['badge'] = $badge;</code></address>
<address><code>if ($sound)</code></address>
<address><code> $body['aps']['sound'] = $sound;</code></address>
<address></address>
<address></address>
<address><code>/* End of Configurable Items */</code></address>
<address></address>
<address><code>$ctx = stream_context_create();</code></address>
<address><code>stream_context_set_option($ctx, 'ssl', 'local_cert', 'ck.pem'); </code></address>
<address><code>// assume the private key passphase was removed.</code></address>
<address><code>// stream_context_set_option($ctx, 'ssl', 'passphrase', $pass);</code></address>
<address></address>
<address><code>$fp = stream_socket_client('ssl://gateway.sandbox.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT, $ctx);</code></address>
<address><code>if (!$fp) {</code></address>
<address><code> print "Failed to connect $err $errstrn";</code></address>
<address><code> return;</code></address>
<address><code>}</code></address>
<address><code>else {</code></address>
<address><code> print "Connection OKn";</code></address>
<address><code>}</code></address>
<address></address>
<address><code>$payload = json_encode($body);</code></address>
<address><code>$msg = chr(0) . pack("n",32) . pack('H*', str_replace(' ', '', $deviceToken)) . pack("n",strlen($payload)) . $payload;</code></address>
<address><code>print "sending message :" . $payload . "n";</code></address>
<address><code>fwrite($fp, $msg);</code></address>
<address><code>fclose($fp);</code></address>
<address><code>?&gt;</code></address>
<address></address>
</dd>
</dl>
<p>(12) For iPhone Client Program, you need to edit the bundle identifier to the App ID that you created and imported the new provisioning profile for that APP ID to the XCode and iPhone. Then implement the following methods in AppDelegate to Build &amp; Go</p>
<p><strong>AppDelegate.m</strong></p>
<dl class="codebox">
<dd style="padding-left: 60px;"><code><br />
</code></p>
<address><code>- (void)applicationDidFinishLaunching:(UIApplication *)application { </code></address>
<address></address>
<address><code> NSLog(@"Registering Remote Notications"); </code></address>
<address></address>
<address><code>// For beta 2</code></address>
<address><code>//  [[UIApplication sharedApplication] registerForRemoteNotifications]; </code></address>
<address></address>
<address><code> [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)]; // For beta 3</code></address>
<address></address>
<address><code> // other codes here</code></address>
<address><code>}</code></address>
<address></address>
<address><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {</code></address>
<address></address>
<address><code> NSLog(@"%@",[[[launchOptions objectForKey:@"UIApplicationLaunchOptionsRemoteNotificationKey"] objectForKey:@"aps"] objectForKey:@"alert"]);</code></address>
<address><code> return YES;</code></address>
<address><code>}</code></address>
<address></address>
<address><code>- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {</code></address>
<address><code> NSLog(@"deviceToken: %@", deviceToken); </code></address>
<address><code>} </code></address>
<address></address>
<address><code>- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {</code></address>
<address><code> NSLog(@"Error in registration. Error: %@", error); </code></address>
<address><code>} </code></address>
<address></address>
</dd>
</dl>
<h4>(13) Additional tips</h4>
<p>- The feedback service is currently unavailable.<br />
- Send your messages to gateway.sandbox.push.apple.com:2195 during the beta period.<br />
- Devices must be set up as new iPhones in iTunes in order to generate device tokens. Restoring from backup is not currently supported.<br />
-Make sure the audio file <code>received5.caf is included in your application resource.<br />
</code></p>
<h4>(13a) Registering an App ID for Apple Push Notification service</h4>
<p>1. In the App ID section of the Program Portal, locate the App ID you wish to use with the Apple Push Notification service. Only App IDs with a specific bundle ID can be used with the APNs. You cannot use a “wild-card” application ID. You must see “Available” under the Apple Push Notification service column to register this App ID and configure a certificate for this App ID.</p>
<p>2. Click the &#8216;Configure&#8217; link next to your desired App ID.</p>
<p>3. In the Configure App ID page, check the Enable Push Notification Services box and click the Configure button. Clicking this button launches the APNs Assistant, which guides you through the next series of steps that create your App ID specific Client SSL certificate.</p>
<p>4. Download the Client SSL certificate file to your download location. Navigate to that location and double-click the certificate file (which has an extension of cer) to install it in your keychain.</p>
<p>5. When you are finished, click Done in the APNS Assistant.</p>
<p>6. Double-clicking the file launches Keychain Access. Make sure you install the certificate in your login keychain on the computer you are using for provider development. The APNs SSL certificate should be installed on your notification server.</p>
<p>7. When you finish these steps you are returned to the Configure App ID page of the iPhone Dev Center portal. The certificate should be badged with a green circle and the label “Enabled”.</p>
<p>8. To complete the APNs set-up process, you will need to create a new provisioning profile containing your APNs-enabled App ID.</p>
<div id="wherego_related"><h3>Readers who viewed this page, also viewed:</h3><ul><li><a href="http://www.macoscoders.com/2009/06/11/add-background-image-to-uiview/" rel="bookmark" class="wherego_title">Add Background Image To UIView</a></li><li><a href="http://www.macoscoders.com/2009/05/19/how-to-set-badge-value-of-an-tabbar-item/" rel="bookmark" class="wherego_title">How to set badge value of an TabBar Item</a></li><li><a href="http://www.macoscoders.com/2009/07/22/enable-https-on-apache-running-on-a-leopard/" rel="bookmark" class="wherego_title">Enable HTTPS On Apache Running On A Leopard</a></li><li><a href="http://www.macoscoders.com/2009/05/13/app-icons-messed-up-with-iphone-os-30-beta-5/" rel="bookmark" class="wherego_title">App Icons Messed Up With iPhone OS 3.0 Beta 5</a></li><li><a href="http://www.macoscoders.com/2009/04/13/apple-announces-iphone-push-notification-service-for-developers/" rel="bookmark" class="wherego_title">Apple announces iPhone push notification service for developers</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/where-did-they-go-from-here/">Where did they go from here?</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.macoscoders.com/2009/05/17/iphone-apple-push-notification-service-apns/feed/</wfw:commentRss>
		<slash:comments>106</slash:comments>
		</item>
		<item>
		<title>iPhone SDK: How To Set Max Character length in UITextField</title>
		<link>http://www.macoscoders.com/2009/05/14/iphone-sdk-how-to-set-max-character-length-in-uitextfield/</link>
		<comments>http://www.macoscoders.com/2009/05/14/iphone-sdk-how-to-set-max-character-length-in-uitextfield/#comments</comments>
		<pubDate>Thu, 14 May 2009 11:55:44 +0000</pubDate>
		<dc:creator>Anish Kumar</dc:creator>
				<category><![CDATA[iPhone Applications]]></category>
		<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[IPhone]]></category>
		<category><![CDATA[NSRange]]></category>
		<category><![CDATA[replacementString]]></category>
		<category><![CDATA[sdk]]></category>
		<category><![CDATA[shouldChangeCharactersInRange]]></category>
		<category><![CDATA[UITextField]]></category>

		<guid isPermaLink="false">http://www.macoscoders.com/?p=181</guid>
		<description><![CDATA[We can use the UITextField&#8217;s delegate method
- (BOOL)textField: (UITextField *)textField shouldChangeCharactersInRange: (NSRange)range replacementString: (NSString *)string

to set the maximum character length.
This can be done by doing the following:
#define MAX_LENGTH 10

- (BOOL)textField: (UITextField *)textField shouldChangeCharactersInRange: (NSRange)range replacementString: (NSString *)string
{
    if (textField.text.length &#62;= MAX_LENGTH &#38;&#38; range.length == 0)
    {
        return NO; 
    [...]]]></description>
			<content:encoded><![CDATA[<p>We can use the UITextField&#8217;s delegate method</p>
<pre class="prettyprint" style="padding-left: 30px;"><code><span class="pun">-</span><span class="pln"> </span><span class="pun">(</span><span class="pln">BOOL</span><span class="pun">)</span><span class="pln">textField</span><span class="pun">: (</span><span class="typ">UITextField</span><span class="pln"> </span><span class="pun">*)</span><span class="pln">textField shouldChangeCharactersInRange</span><span class="pun">: (</span><span class="typ">NSRange</span><span class="pun">)</span><span class="pln">range replacementString</span><span class="pun">: (</span><span class="typ">NSString</span><span class="pln"> </span><span class="pun">*)</span><span class="kwd">string
</span></code></pre>
<p>to set the maximum character length.</p>
<p>This can be done by doing the following:</p>
<pre class="prettyprint" style="padding-left: 30px;"><code><span class="com">#define MAX_LENGTH 10</span><span class="pln">

</span><span class="pun">-</span><span class="pln"> </span><span class="pun">(</span><span class="pln">BOOL</span><span class="pun">)</span><span class="pln">textField</span><span class="pun">: (</span><span class="typ">UITextField</span><span class="pln"> </span><span class="pun">*)</span><span class="pln">textField shouldChangeCharactersInRange</span><span class="pun">: (</span><span class="typ">NSRange</span><span class="pun">)</span><span class="pln">range replacementString</span><span class="pun">: (</span><span class="typ">NSString</span><span class="pln"> </span><span class="pun">*)</span><span class="kwd">string</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
    </span><span class="kwd">if</span><span class="pln"> </span><span class="pun">(</span><span class="pln">textField</span><span class="pun">.</span><span class="pln">text</span><span class="pun">.</span><span class="pln">length </span><span class="pun">&gt;=</span><span class="pln"> MAX_LENGTH </span><span class="pun">&amp;&amp;</span><span class="pln"> range</span><span class="pun">.</span><span class="pln">length </span><span class="pun">==</span><span class="pln"> </span><span class="lit">0</span><span class="pun">)</span><span class="pln">
    </span><span class="pun">{</span><span class="pln">
        </span><span class="kwd">return</span><span class="pln"> NO</span><span class="pun">;</span><span class="pln"> </span><span class="pln">
    </span><span class="pun">}</span><span class="pln">
    </span><span class="kwd">else</span><span class="pln">
    </span><span class="pun">{</span><span class="kwd">
        return</span><span class="pln"> YES</span><span class="pun">;
    }</span><span class="pln">
</span><span class="pun">}</span><span class="pln">
</span></code></pre>
<div id="wherego_related"><h3>Readers who viewed this page, also viewed:</h3><ul><li><a href="http://www.macoscoders.com/2009/06/11/add-background-image-to-uiview/" rel="bookmark" class="wherego_title">Add Background Image To UIView</a></li><li><a href="http://www.macoscoders.com/2009/05/17/iphone-apple-push-notification-service-apns/" rel="bookmark" class="wherego_title">iPhone Apple Push Notification Service (APNS)</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/where-did-they-go-from-here/">Where did they go from here?</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.macoscoders.com/2009/05/14/iphone-sdk-how-to-set-max-character-length-in-uitextfield/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>iPhone: Place A UIView On Top Of Other Views</title>
		<link>http://www.macoscoders.com/2009/05/14/iphone-place-a-uiview-on-top-of-other-views/</link>
		<comments>http://www.macoscoders.com/2009/05/14/iphone-place-a-uiview-on-top-of-other-views/#comments</comments>
		<pubDate>Thu, 14 May 2009 09:59:45 +0000</pubDate>
		<dc:creator>Anish Kumar</dc:creator>
				<category><![CDATA[iPhone Applications]]></category>
		<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[IPhone]]></category>
		<category><![CDATA[sdk]]></category>
		<category><![CDATA[UIView]]></category>
		<category><![CDATA[zPosition]]></category>

		<guid isPermaLink="false">http://www.macoscoders.com/?p=178</guid>
		<description><![CDATA[There might be need at several stages of iPhone application development to insert a new view on top of other views. This can be achieved by setting the zPosition value of the view in question. If a View has a zPosition that is bigger than another views zPosition it will appear on top of the [...]]]></description>
			<content:encoded><![CDATA[<p>There might be need at several stages of iPhone application development to insert a new view on top of other views. This can be achieved by setting the zPosition value of the view in question. If a View has a zPosition that is bigger than another views zPosition it will appear on top of the other view.</p>
<p style="padding-left: 30px;"><span id="more-178"></span>UIView *myView = [[UIView alloc] init];<br />
myView.layer.zPosition = X;</p>
<div id="wherego_related"><h3>Readers who viewed this page, also viewed:</h3><ul><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/where-did-they-go-from-here/">Where did they go from here?</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.macoscoders.com/2009/05/14/iphone-place-a-uiview-on-top-of-other-views/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>App Icons Messed Up With iPhone OS 3.0 Beta 5</title>
		<link>http://www.macoscoders.com/2009/05/13/app-icons-messed-up-with-iphone-os-30-beta-5/</link>
		<comments>http://www.macoscoders.com/2009/05/13/app-icons-messed-up-with-iphone-os-30-beta-5/#comments</comments>
		<pubDate>Wed, 13 May 2009 12:30:56 +0000</pubDate>
		<dc:creator>Anish Kumar</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[iPhone Applications]]></category>
		<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[3.0]]></category>
		<category><![CDATA[app store]]></category>
		<category><![CDATA[battery]]></category>
		<category><![CDATA[beta 5]]></category>
		<category><![CDATA[drain]]></category>
		<category><![CDATA[icons]]></category>
		<category><![CDATA[IPhone]]></category>
		<category><![CDATA[messed up]]></category>
		<category><![CDATA[missing]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[seed 5]]></category>
		<category><![CDATA[without]]></category>

		<guid isPermaLink="false">http://www.macoscoders.com/?p=176</guid>
		<description><![CDATA[With the latest release of iPhone OS 3.0 seed 5, the icons of the applications are being messed up. This mostly occurs when we install updates to the applications from App store. Few applications will not have any icons altogether, few apps have icons of their neighbouring apps like shown in the figure. iPhone OS [...]]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignleft" style="width: 202px"><img title="Messed Up Icons With iPhone OS 3.0 Beta 5" src="http://www.macoscoders.com/images/Messed_Up_Icons_With_Iphone_3_0_Beta_5.jpg" alt="Messed Up Icons With iPhone OS 3.0 Beta 5" width="192" height="288" /><p class="wp-caption-text">Messed Up Icons With iPhone OS 3.0 Beta 5</p></div>
<p>With the latest release of iPhone OS 3.0 seed 5, the icons of the applications are being messed up. This mostly occurs when we install updates to the applications from App store. Few applications will not have any icons altogether, few apps have icons of their neighbouring apps like shown in the figure. iPhone OS 3.0 beta 5 is lot more buggier than beta 4 or beta 3. Also I have observed beta 5 drains the battery very fast. My iPhone lost more than half of its power over night even without performing any tasks while lying idle. Seems Apple has purposefully made beta 5 buggy so that users are forced to move to the final version expected in the WWDC.</p>
<p>On the screenshot we can observe that, PingPongLite application doesnt have icon at all and NewsPro and Bloomberg have same icons.</p>
<p>However on a positive note, if we restart the iPhone, all icons are restored to their original application icons.</p>
<h2><span id="more-176"></span><strong></strong></h2>
<h2></h2>
<h2></h2>
<h2><strong>Update:</strong></h2>
<p>The messed up icons issue has been fixed with the latest iPhone OS 3.0 GM build. Also with the GM build my iPhone runs relatively for a longer duration on a full battery charge than what I used to get with beta 5. (But still I feel 3.0 is consuming too much of battery than 2.2.1)</p>
<div id="wherego_related"><h3>Readers who viewed this page, also viewed:</h3><ul><li><a href="http://www.macoscoders.com/2010/06/07/opening-app-review-page-of-app-store/" rel="bookmark" class="wherego_title">Opening App Review Page Of App Store</a></li><li><a href="http://www.macoscoders.com/2009/05/17/iphone-apple-push-notification-service-apns/" rel="bookmark" class="wherego_title">iPhone Apple Push Notification Service (APNS)</a></li><li><a href="http://www.macoscoders.com/2009/06/08/error-the-executable-was-signed-with-invalid-entitlements/" rel="bookmark" class="wherego_title">Error: The executable was signed with invalid entitlements</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/where-did-they-go-from-here/">Where did they go from here?</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.macoscoders.com/2009/05/13/app-icons-messed-up-with-iphone-os-30-beta-5/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>NSTask Removed From IPhone SDK 3.0</title>
		<link>http://www.macoscoders.com/2009/05/04/nstask-removed-from-iphone-sdk-30/</link>
		<comments>http://www.macoscoders.com/2009/05/04/nstask-removed-from-iphone-sdk-30/#comments</comments>
		<pubDate>Mon, 04 May 2009 10:42:22 +0000</pubDate>
		<dc:creator>Anish Kumar</dc:creator>
				<category><![CDATA[iPhone Applications]]></category>
		<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[3.0]]></category>
		<category><![CDATA[GData]]></category>
		<category><![CDATA[GDATA_SKIP_LOG_XMLFORMAT]]></category>
		<category><![CDATA[IPhone]]></category>
		<category><![CDATA[NSTask]]></category>
		<category><![CDATA[sdk]]></category>

		<guid isPermaLink="false">http://www.macoscoders.com/?p=163</guid>
		<description><![CDATA[The other day I was trying to build GData with one of my iPhone applications built on iPhone SDK 3.0. The build failed complaining that NSTask is undeclared.  Based on release notes for iPhone OS 3.0, I got to know that NSTask has been removed from the Foundation framework among several other API&#8217;s with iPhone [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I was trying to build GData with one of my iPhone applications built on iPhone SDK 3.0. The build failed complaining that NSTask is undeclared.  Based on release notes for iPhone OS 3.0, I got to know that NSTask has been removed from the Foundation framework among several other API&#8217;s with iPhone OS 3.0. <img src='http://www.macoscoders.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' />   Moving forward all projects which used NSTask would fail n would require some amount of recoding to fill the missing gaps.</p>
<p><span id="more-163"></span>For now I am setting GDATA_SKIP_LOG_XMLFORMAT = 1 for my project to compile without any error.</p>
<div class="wp-caption aligncenter" style="width: 439px"><img title="NSTask Missing In iPhone OS 3.0" src="http://www.macoscoders.com/images/Missing_NSTask_iPhone_OS_3_0.jpg" alt="NSTask Missing In iPhone OS 3.0" width="429" height="195" /><p class="wp-caption-text">NSTask Missing In iPhone OS 3.0</p></div>
<div id="wherego_related"><h3>Readers who viewed this page, also viewed:</h3><ul><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/where-did-they-go-from-here/">Where did they go from here?</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.macoscoders.com/2009/05/04/nstask-removed-from-iphone-sdk-30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
