<?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>Indie iPhone Development Blog &#187; iPad</title>
	<atom:link href="http://blog.indieiphonedev.com/tag/ipad/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.indieiphonedev.com</link>
	<description>The musings of an independent iPhone developer</description>
	<lastBuildDate>Mon, 20 Jun 2011 18:48:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Why the $100 iTunes gift card back to school promotion is a great deal for Apple and iWorks</title>
		<link>http://blog.indieiphonedev.com/2011/06/20/why-the-100-itunes-gift-card-back-to-school-promotion-is-a-great-deal-for-apple-and-iworks/</link>
		<comments>http://blog.indieiphonedev.com/2011/06/20/why-the-100-itunes-gift-card-back-to-school-promotion-is-a-great-deal-for-apple-and-iworks/#comments</comments>
		<pubDate>Mon, 20 Jun 2011 18:47:09 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Opinion]]></category>
		<category><![CDATA[documents]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iWorks]]></category>
		<category><![CDATA[keynote]]></category>
		<category><![CDATA[numbers]]></category>
		<category><![CDATA[pages]]></category>
		<category><![CDATA[Word]]></category>

		<guid isPermaLink="false">http://blog.indieiphonedev.com/?p=310</guid>
		<description><![CDATA[There have been a couple of posts lately on why the $100 iTunes gift card is better than the previous iPod touch promotion. I fully agree that the economics are greatly in Apple&#8217;s favor since they get to make back the 30% on apps from the Mac App Store and the iOS App Store, books [...]]]></description>
			<content:encoded><![CDATA[<p>There have been a couple of posts lately on why the $100 iTunes gift card is better than the previous iPod touch promotion.  I fully agree that the economics are greatly in Apple&#8217;s favor since they get to make back the 30% on apps from the Mac App Store and the iOS App Store, books from their iBooks bookstore, and whatever their cut is of music purchased.  But I have another reason why I think it is an amazing idea:<br />
<P><br />
One of the main questions I get from people buying iPads is &#8220;how do I edit Word documents on the iPad?&#8221;.  Right now there is no great solution for this.  You can buy 3rd party apps that will let you open documents from your dropbox folder and edit them &#8211; but as anyone who have tried this can attest &#8211; there is a very high probability that any document edited in a 3rd party app will look very different when you open it on your PC in Word later.  At best the fonts and alignments may be off at worst you may have just lost all the tracked changes that someone made.<br />
<P><br />
I am sure that this is a huge factor for people wanting to use the iPad for work.  People have told me that they are using citrix or remote desktop clients to access PCs so they can edit docs on the iPad, which just seems to defeat the whole purpose of having an iPad.<br />
<P><br />
By Apple giving $100 to students they are giving a big discount on the iWorks suite (or maybe the students will just use it on music and games and ask their parents for $ for the iWorks suite). I hope that this will increase the number of people that adopt the Apple document platform and get people away from Word.  With iCloud coming soon we will be able to open our Pages/Numbers/Keynote documents on the iPad / PC / Web (??).  Personally, if the iPad could do documents well I would not need to bring a laptop when traveling anymore.<br />
<P></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.indieiphonedev.com%2F2011%2F06%2F20%2Fwhy-the-100-itunes-gift-card-back-to-school-promotion-is-a-great-deal-for-apple-and-iworks%2F&amp;title=Why%20the%20%24100%20iTunes%20gift%20card%20back%20to%20school%20promotion%20is%20a%20great%20deal%20for%20Apple%20and%20iWorks" id="wpa2a_2"><img src="http://blog.indieiphonedev.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.indieiphonedev.com/2011/06/20/why-the-100-itunes-gift-card-back-to-school-promotion-is-a-great-deal-for-apple-and-iworks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Implementing iAd in iPhone applications</title>
		<link>http://blog.indieiphonedev.com/2011/04/27/implementing-iad-in-iphone-applications/</link>
		<comments>http://blog.indieiphonedev.com/2011/04/27/implementing-iad-in-iphone-applications/#comments</comments>
		<pubDate>Wed, 27 Apr 2011 05:11:33 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[free app]]></category>
		<category><![CDATA[iAd]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[objective-C]]></category>
		<category><![CDATA[source code]]></category>

		<guid isPermaLink="false">http://blog.indieiphonedev.com/?p=296</guid>
		<description><![CDATA[There are a couple of tricks to implementing iAd in iPhone applications that are not 100% spelled out in the documentation provided by Apple. If you do not implement right your app will crash on phones running older versions of iOS such as iOS4.1 and iOS3. For your .h file: In the .m file you [...]]]></description>
			<content:encoded><![CDATA[<p>There are a couple of tricks to implementing iAd in iPhone applications that are not 100% spelled out in the documentation provided by Apple.  If you do not implement right your app will crash on phones running older versions of iOS such as iOS4.1 and iOS3. </p>
<p>For your .h file:</p>
<pre class="brush: objc; title: ; notranslate">
#import &lt;UIKit/UIKit.h&gt;;
#import &lt;iAd/iAd.h&gt;;
@interface iAdViewController : UIViewController &lt;ADBannerViewDelegate&gt; {
	ADBannerView *adView;
 	BOOL bannerIsVisible;
}
@property (nonatomic,assign) BOOL bannerIsVisible;
@end
</pre>
<p>In the .m file you need the following:</p>
<pre class="brush: objc; title: ; notranslate">
- (void) viewWillAppear:(BOOL)animated {
	// check if iAd is available
	Class classAdBannerView = NSClassFromString(@&quot;ADBannerView&quot;);
	if (classAdBannerView) {
		// create iAd
		ADBannerView *bannerView = [[classAdBannerView alloc] initWithFrame:CGRectZero];

		if (&amp;ADBannerContentSizeIdentifierPortrait != nil) {
			// NEWER
			DLog(@&quot;NEWER&quot;);
			bannerView.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifierPortrait];
			bannerView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
		} else {
			// OLDER
			DLog(@&quot;OLDER&quot;);
			bannerView.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifier320x50];
			bannerView.currentContentSizeIdentifier = ADBannerContentSizeIdentifier320x50;
		}

		bannerView.delegate=self;

		self.adView = bannerView;
		[self.view addSubview:adView];
		self.bannerIsVisible=NO;
		[bannerView release];

	}
	[super viewWillAppear: animated];
}
</pre>
<p>I am creating the bannerView programatically in order to have the app also work on pre iOS 4.1 devices.  The check for ADBannerContentSizeIdentifierPortrait is to see if the user is using iOS 4.1 or newer iOS.  In iOS 4.1 the identifiers were based on size &#8211; but in newer iOS the iPad got iAds and the size no longer made sense &#8211; thus the landscape/portrait designations.</p>
<p>Finally &#8211; if your app supports multiple interface orientations &#8211; you need to let the banner know that the device rotated so it can show the right size ad.</p>
<pre class="brush: objc; title: ; notranslate">
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {

    if (&amp;ADBannerContentSizeIdentifierPortrait != nil) {
        // NEWER
		DLog(@&quot;NEWER&quot;);
        if (UIInterfaceOrientationIsLandscape(toInterfaceOrientation))
            adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierLandscape;
        else
            adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
    } else {
        // OLDER
		DLog(@&quot;OLDER&quot;);
        if (UIInterfaceOrientationIsLandscape(toInterfaceOrientation))
            adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifier480x32;
        else
            adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifier320x50;
    }
}
</pre>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.indieiphonedev.com%2F2011%2F04%2F27%2Fimplementing-iad-in-iphone-applications%2F&amp;title=Implementing%20iAd%20in%20iPhone%20applications" id="wpa2a_4"><img src="http://blog.indieiphonedev.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.indieiphonedev.com/2011/04/27/implementing-iad-in-iphone-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Converting App from iPhone to Universal</title>
		<link>http://blog.indieiphonedev.com/2010/04/29/converting-app-from-iphone-to-universal/</link>
		<comments>http://blog.indieiphonedev.com/2010/04/29/converting-app-from-iphone-to-universal/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 03:54:47 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone app]]></category>
		<category><![CDATA[objective-C]]></category>
		<category><![CDATA[source code]]></category>

		<guid isPermaLink="false">http://blog.indieiphonedev.com/?p=194</guid>
		<description><![CDATA[With the iPad selling like hot cakes it seems like a good idea to get on the bandwagon and make some apps for the iPad.  The LogYourRun app is not particularly well suited for running on the iPad &#8211; I doubt that people will be strapping their iPads to their arms and run around the [...]]]></description>
			<content:encoded><![CDATA[<p>With the iPad selling like hot cakes it seems like a good idea to get on the bandwagon and make some apps for the iPad.  The LogYourRun app is not particularly well suited for running on the iPad &#8211; I doubt that people will be strapping their iPads to their arms and run around the park.  However, the heart rate app seems like something that people would enjoy using even on iPads.  Since I did not want to have to maintain two separate apps I decided to make the app universal.  This was actually quite an easy process and took only about 10-12 hours (could have been faster if I had known what I was doing &#8211; which is why I wanted to share what I learned).</p>
<p>First step is to make sure you copy your application folder so you will be able to go back to the original application if you mess up.  Then with your newly copied application upgrade your target to work on the iPad in addition to the iPhone.  Click on your target and go into the menu &#8211; under Project you will find an entry that says &#8220;upgrade current target for iPad&#8221;.  Select the &#8220;One Universal application&#8221; option.  This will generate a new group which contains your new iPad version of the MainWindow.xib file &#8211; MainWindow-iPad.xib.  You can use this new nib to load all your iPad specific views.</p>
<p>At this point I went through all my existing nibs and created iPad versions (can be done in the Interface Builder) and saved them as XxxViewController-iPad.xib in the Resources-iPad folder.  For iPad nibs you have to make sure that you have versions of the nib that look decent and are usable in both landscape and horizontal orientations.  This can be tricky if you have a lot of UI elements but is very important since iPad apps have to support all orientations.  Make sure you anchor your UI elements to the right edges and that they scale to look nice.</p>
<p>The heart rate app uses a tab bar.  It took me the longest time to figure out how to get this to rotate.  The reason for this was that I had not read <a href="http://developer.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/TabBarControllers/TabBarControllers.html#//apple_ref/doc/uid/TP40007457-CH102-SW26" target="_blank">Apple&#8217;s documentation</a>.  Turns out that <strong>all</strong> the view controllers that the tab bar links to have to return YES for all shouldAutorotateToInterfaceOrientation: orientations.  This makes sense conceptually.  In addition you need to <a href="http://blog.costan.us/2009/01/auto-rotating-tab-bars-on-iphone.html">set your view controllers</a> to automatically resize when rotation occurs.  Once these are set you will be able to see what the rotation looks like in the iPad simulator (hopefully great).</p>
<p>Loading the iPad specific nibs using the view controller is a great way to get these to show up on the iPad only &#8211; but there are some cases where you will need to load a view controller programatically (in my case when the user clicks on the help button it brings up the help VC).  To make sure that you load the right nib you can check if the app is running on the iPad.  The following code is what I used:</p>
<pre>
<pre class="brush: objc; title: ; notranslate">
- (BOOL) isIPad {
#if (__IPHONE_OS_VERSION_MAX_ALLOWED &gt;= 30200)
  if ([[UIDevice currentDevice] respondsToSelector: @selector(userInterfaceIdiom)])
    return ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad);
#endif

  return NO;
}
</pre>
</pre>
<p>This code will check if the iDevice responds to the userInterfaceIdiom selector and if it does it checks if the device is an iPad.  If it is I load the iPad version of the helpVC if not then I load the iPhone version of the helpVC.  Make sure you also put the respondToRotation in these VCs since they will need to respond predictably also.</p>
<p>Finally you will need to create a default image that can be presented on the iPhone.  In your info.plist you can set the &#8220;Launch image (iPad)&#8221; to the base name of the iPad graphic (e.g. Default-iPad.png).  You can then create two images named Default-iPad-Landscape and Default-iPad-Portrait and add them to your project.  The iPad will pick whichever of the default images that fits with the rotation of the device.</p>
<p>When uploading your app &#8211; build the app in OS3.2.  The app will run on both iPhone and iPad from one binary. You will also have to upload screenshots for the iPad version for display in the iPad app store and create two new icons (50&#215;50 and 72&#215;72).  Once you have all that together your app is ready for submission and you can start praying that it will be a speedy path to acceptance.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.indieiphonedev.com%2F2010%2F04%2F29%2Fconverting-app-from-iphone-to-universal%2F&amp;title=Converting%20App%20from%20iPhone%20to%20Universal" id="wpa2a_6"><img src="http://blog.indieiphonedev.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.indieiphonedev.com/2010/04/29/converting-app-from-iphone-to-universal/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

