<?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>iphoneアプリで稼げるのか &#187; 横向き</title>
	<atom:link href="http://iphone.longearth.net/tag/%e6%a8%aa%e5%90%91%e3%81%8d/feed/" rel="self" type="application/rss+xml" />
	<link>http://iphone.longearth.net</link>
	<description></description>
	<lastBuildDate>Sun, 08 Aug 2010 21:05:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>アプリをiPhone OS 3.0へ対応させる時がきました</title>
		<link>http://iphone.longearth.net/2009/05/09/%e3%82%a2%e3%83%97%e3%83%aa%e3%82%92iphone-os-30%e3%81%b8%e5%af%be%e5%bf%9c%e3%81%95%e3%81%9b%e3%82%8b%e6%99%82%e3%81%8c%e3%81%8d%e3%81%be%e3%81%97%e3%81%9f/</link>
		<comments>http://iphone.longearth.net/2009/05/09/%e3%82%a2%e3%83%97%e3%83%aa%e3%82%92iphone-os-30%e3%81%b8%e5%af%be%e5%bf%9c%e3%81%95%e3%81%9b%e3%82%8b%e6%99%82%e3%81%8c%e3%81%8d%e3%81%be%e3%81%97%e3%81%9f/#comments</comments>
		<pubDate>Sat, 09 May 2009 01:25:37 +0000</pubDate>
		<dc:creator>daichi</dc:creator>
				<category><![CDATA[iphone開発]]></category>
		<category><![CDATA[App Store]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[iSlot]]></category>
		<category><![CDATA[iSlot Pro]]></category>
		<category><![CDATA[OS 3.0]]></category>
		<category><![CDATA[UIViewController]]></category>
		<category><![CDATA[アプリ]]></category>
		<category><![CDATA[パチスロ]]></category>
		<category><![CDATA[リリース]]></category>
		<category><![CDATA[収支]]></category>
		<category><![CDATA[横向き]]></category>

		<guid isPermaLink="false">http://iphone.longearth.net/?p=600</guid>
		<description><![CDATA[
Apple、iPhoneアプリは今後3.0互換でなければ受付けないと通告

ついにAppleが今後の提出アプリはiPhone 0S 3.0との互換性をmustにしてきました。
既存のアプリは互換性がない限りApp St [...]]]></description>
			<content:encoded><![CDATA[<p>
<a href="http://jp.techcrunch.com/archives/20090507its-30-or-die-for-new-iphone-apps/">Apple、iPhoneアプリは今後3.0互換でなければ受付けないと通告</a><br />
<br />
ついにAppleが今後の提出アプリはiPhone 0S 3.0との互換性をmustにしてきました。<br />
既存のアプリは互換性がない限りApp Store上から削除されてしまうとのこと。<br />
<br />
iPhone OS bataでの仕様変更も概ね終了して、今後は微調整程度になるんでしょう。<br />
<br />
<span id="more-600"></span><br />
<br />
実はうちのiSlot Proも動かない部分があります。<br />
それは以前エントリにも書いたこの部分。<br />
<a href="http://iphone.longearth.net/2009/04/07/%e3%80%90uiviewcontroller%e3%80%91iphone%e3%82%92%e6%a8%aa%e5%90%91%e3%81%8d%e3%81%ab%e3%81%97%e3%81%9f%e6%99%82%e3%81%ab%e5%88%a5%e7%94%bb%e9%9d%a2%e3%82%92%e8%a1%a8%e7%a4%ba%e3%81%99%e3%82%8b/">【UIVIewController】iPhoneを横向きにした時に別画面を表示する方法 | iphoneアプリで稼げるのか</a><br />
<br />
shouldAutorotateToInterfaceOrientationの呼ばれるタイミングが2.0と3.0では違っていて、2.0だとviewWillAppearの後には呼ばれないため、正常に動くのですが、3.0ではviewWillAppear後にもこれが呼ばれてしまうので、呼ばれた直後に呼び出し元に処理が戻り、無限ループに陥るという。。。<br />
<br />
これまでbetaに変更が入るたびに、微妙に動作が変わっていたので、最終的には2.0系と同じ動作に落ち着くのかなと思い、対応を保留にしていたのですが、今回のbeta 5での動作次第では修正が必要になるかも。<br />
<br />
あいにくiPhoneへのbeta 5インストールに失敗して、今はただのぶんちんに成り下がってしまったのでiPhone復活後に動作を確認してみます。<br />
<br />
ただ気になるのはSimple FXとか他のiPhone横向きで画面をロードするアプリ達は正常に動いてるところ。単に僕の実装方法が異質なのかも。<br />
<br />
どなたかOS 3.0で正常に動くiPhone横向き時に別画面を起動するサンプルソースのありかなどご存知でしたら教えていただけるととても助かります。というひとりごと。<br />
<br />
<h3>関連のあるアプリ</h3>
<div style="float:left; margin-right:10px; margin-bottom:10px">
<a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=307729455&amp;mt=8"><img src="http://iphone.longearth.net/wp-content/uploads/2008/12/islot_icon.png" alt="islot_icon" title="islot_icon" width="57" height="57" class="alignnone size-full wp-image-502" /></a><br />
</div>
<div style="float:left">
<a href="http://iphone.longearth.net/2009/03/14/%E3%80%90app-store%E3%80%91iphone%E3%81%A7%E6%A9%9F%E4%BC%9A%E5%89%B2%E7%AE%97%E5%87%BA%E3%81%8C%E3%81%A7%E3%81%8D%E3%82%8B%E3%83%91%E3%83%81%E3%82%B9%E3%83%AD%E5%8F%8E%E6%94%AF%E7%AE%A1%E7%90%86/">iSlot Pro</a> 2009/03/13 リリース<br />
ファイナンス　350円<br />
パチスロ収支管理アプリ<br />
</div>
<div style="float:right">
<a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=307729455&amp;mt=8"><img src="http://iphone.longearth.net/wp-content/uploads/2008/12/app_store_badge.png" alt="app_store_badge" title="app_store_badge" width="157" height="57" class="alignnone size-full wp-image-505" /></a><br />
</div>
<div style="clear:both"></div></p>

	<p>タグ: <a href="http://iphone.longearth.net/tag/app-store/" title="App Store" rel="tag nofollow">App Store</a>, <a href="http://iphone.longearth.net/tag/iphone/" title="iphone" rel="tag nofollow">iphone</a>, <a href="http://iphone.longearth.net/tag/islot/" title="iSlot" rel="tag nofollow">iSlot</a>, <a href="http://iphone.longearth.net/tag/islot-pro/" title="iSlot Pro" rel="tag nofollow">iSlot Pro</a>, <a href="http://iphone.longearth.net/tag/os-30/" title="OS 3.0" rel="tag nofollow">OS 3.0</a>, <a href="http://iphone.longearth.net/tag/uiviewcontroller/" title="UIViewController" rel="tag nofollow">UIViewController</a>, <a href="http://iphone.longearth.net/tag/%e3%82%a2%e3%83%97%e3%83%aa/" title="アプリ" rel="tag nofollow">アプリ</a>, <a href="http://iphone.longearth.net/tag/%e3%83%91%e3%83%81%e3%82%b9%e3%83%ad/" title="パチスロ" rel="tag nofollow">パチスロ</a>, <a href="http://iphone.longearth.net/tag/%e3%83%aa%e3%83%aa%e3%83%bc%e3%82%b9/" title="リリース" rel="tag nofollow">リリース</a>, <a href="http://iphone.longearth.net/tag/%e5%8f%8e%e6%94%af/" title="収支" rel="tag nofollow">収支</a>, <a href="http://iphone.longearth.net/tag/%e6%a8%aa%e5%90%91%e3%81%8d/" title="横向き" rel="tag nofollow">横向き</a></p>

	<h4>関連する投稿</h4>
	<ul class="st-related-posts">
	<li><a href="http://iphone.longearth.net/2009/04/07/%e3%80%90uiviewcontroller%e3%80%91iphone%e3%82%92%e6%a8%aa%e5%90%91%e3%81%8d%e3%81%ab%e3%81%97%e3%81%9f%e6%99%82%e3%81%ab%e5%88%a5%e7%94%bb%e9%9d%a2%e3%82%92%e8%a1%a8%e7%a4%ba%e3%81%99%e3%82%8b/" title="【UIVIewController】iPhoneを横向きにした時に別画面を表示する方法 (2009 年 4 月 7 日)">【UIVIewController】iPhoneを横向きにした時に別画面を表示する方法</a> </li>
	<li><a href="http://iphone.longearth.net/2009/05/13/apple%e3%81%ae%e4%b8%ad%e3%81%ae%e4%ba%ba%e3%81%afos30%e5%af%be%e5%bf%9c%e5%af%a9%e6%9f%bb%e3%82%92%e7%99%ba%e8%a1%a8%e3%81%be%e3%81%a7%e3%81%ab%e3%81%93%e3%81%aa%e3%81%9b%e3%82%8b%e3%81%ae%e3%81%8b/" title="Appleの中の人はOS3.0対応審査を発表までにこなせるのか (2009 年 5 月 13 日)">Appleの中の人はOS3.0対応審査を発表までにこなせるのか</a> </li>
	<li><a href="http://iphone.longearth.net/2009/05/16/%e7%b7%8f%e5%90%88%e5%a3%b2%e4%b8%8a/" title="総合売上 (2009 年 5 月 16 日)">総合売上</a> </li>
	<li><a href="http://iphone.longearth.net/2009/03/29/%e3%80%90%e3%83%8b%e3%82%b3%e3%83%8b%e3%82%b3%e3%80%91iphone%e3%82%a2%e3%83%97%e3%83%aa%e8%b2%a9%e4%bf%83%e7%94%a8%e3%83%87%e3%83%a2%e5%8b%95%e7%94%bb%e3%82%92%e4%bd%9c%e6%88%90%e3%81%97%e3%81%a6/" title="【ニコニコ】iPhoneアプリ販促用デモ動画を作成してみた (2009 年 3 月 29 日)">【ニコニコ】iPhoneアプリ販促用デモ動画を作成してみた</a> </li>
	<li><a href="http://iphone.longearth.net/2009/02/26/%e3%80%90uitableview%e3%80%91grouped%e3%81%aa%e3%83%86%e3%83%bc%e3%83%96%e3%83%ab%e3%81%ae%e3%82%b9%e3%82%af%e3%83%ad%e3%83%bc%e3%83%ab%e3%81%8c%e9%87%8d%e3%81%84/" title="【UITableView】Groupedなテーブルのスクロールが重い (2009 年 2 月 26 日)">【UITableView】Groupedなテーブルのスクロールが重い</a> </li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://iphone.longearth.net/2009/05/09/%e3%82%a2%e3%83%97%e3%83%aa%e3%82%92iphone-os-30%e3%81%b8%e5%af%be%e5%bf%9c%e3%81%95%e3%81%9b%e3%82%8b%e6%99%82%e3%81%8c%e3%81%8d%e3%81%be%e3%81%97%e3%81%9f/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>【UIVIewController】iPhoneを横向きにした時に別画面を表示する方法</title>
		<link>http://iphone.longearth.net/2009/04/07/%e3%80%90uiviewcontroller%e3%80%91iphone%e3%82%92%e6%a8%aa%e5%90%91%e3%81%8d%e3%81%ab%e3%81%97%e3%81%9f%e6%99%82%e3%81%ab%e5%88%a5%e7%94%bb%e9%9d%a2%e3%82%92%e8%a1%a8%e7%a4%ba%e3%81%99%e3%82%8b/</link>
		<comments>http://iphone.longearth.net/2009/04/07/%e3%80%90uiviewcontroller%e3%80%91iphone%e3%82%92%e6%a8%aa%e5%90%91%e3%81%8d%e3%81%ab%e3%81%97%e3%81%9f%e6%99%82%e3%81%ab%e5%88%a5%e7%94%bb%e9%9d%a2%e3%82%92%e8%a1%a8%e7%a4%ba%e3%81%99%e3%82%8b/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 15:31:26 +0000</pubDate>
		<dc:creator>daichi</dc:creator>
				<category><![CDATA[iphone開発]]></category>
		<category><![CDATA[Interface Builder]]></category>
		<category><![CDATA[iPachi]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[iSlot]]></category>
		<category><![CDATA[iSlot Pro]]></category>
		<category><![CDATA[objecti]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[UIViewController]]></category>
		<category><![CDATA[アプリ]]></category>
		<category><![CDATA[パチスロ]]></category>
		<category><![CDATA[リリース]]></category>
		<category><![CDATA[収支]]></category>
		<category><![CDATA[回転]]></category>
		<category><![CDATA[変換]]></category>
		<category><![CDATA[検知]]></category>
		<category><![CDATA[横向き]]></category>

		<guid isPermaLink="false">http://iphone.longearth.net/?p=474</guid>
		<description><![CDATA[
これだいぶやられました。
こんな風にただ横向きに画面を表示したいだけなのですが、ハマり倒しました。



二度とやられないためにもここに残します。


本体回転の検知
横向きにした時に別画面を表示するには、まず横向きを [...]]]></description>
			<content:encoded><![CDATA[<p>
これだいぶやられました。<br />
こんな風にただ横向きに画面を表示したいだけなのですが、ハマり倒しました。<br />
<br />
<a href="http://iphone.longearth.net/wp-content/uploads/2009/04/picture-1.png"><img class="alignnone size-medium wp-image-478" title="横向き画面" src="http://iphone.longearth.net/wp-content/uploads/2009/04/picture-1-300x161.png" alt="横向き画面" width="300" height="161" /></a><br />
<br />
二度とやられないためにもここに残します。<br />
<br />
<span id="more-474"></span><br />
<h3>本体回転の検知</h3>
横向きにした時に別画面を表示するには、まず横向きを検知する必要があります。<br />
UIViewControllerの以下のメソッドで本体の回転状態を検知できます。<br />
<br />

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p474code7'); return false;">View Code</a> OBJECTIVE-C</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p4747"><td class="code" id="p474code7"><pre class="objective-c" style="font-family:monospace;"> - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {</pre></td></tr></table></div>

<br />
<br />
このメソッドでNOを返せばViewの自動回転をしない、YESを返せば自動回転をする、という設定になります。<br />
が、加えて引数のinterfaceOrientationの状態を見れば本体がどの向きになっているのかを検知できます。<br />
<br />
UIInterfaceOrientationはenumで値はそれぞれ以下の状態を表します。<br />
<ul>
	<li>UIInterfaceOrientationPortrait</li>
これはホームボタンが画面の下側にある状態。通常の状態。<br />
	<li> UIInterfaceOrientationPortraitUpsideDown</li>
これはホームボタンが画面の上側にある状態。通常と逆さまの状態。<br />
	<li> UIInterfaceOrientationLandscapeLeft</li>
これはホームボタンが画面の左側にある状態。右に傾けた状態。<br />
	<li> UIInterfaceOrientationLandscapeRight</li>
これはホームボタンが画面の右側にある状態。左に傾けた状態。</ul>
本体を横向きにした場合に、別画面を表示するコードはこんな感じ。<br />
<br />

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p474code8'); return false;">View Code</a> OBJECTIVE-C</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p4748"><td class="code" id="p474code8"><pre class="objective-c" style="font-family:monospace;"> - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
       //ホームボタンが下以外にある状態なら
 	if (UIInterfaceOrientationPortrait != interfaceOrientation){
&nbsp;
		iPachiAppDelegate *delegate = (iPachiAppDelegate *)[[UIApplication sharedApplication] delegate];
&nbsp;
               // Fade In Out のアニメーションで表示
		CATransition* animation;
		animation = [CATransition animation];
		animation.type = kCATransitionFade;
&nbsp;
		[[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES];
&nbsp;
		GraffController *graff = [ControllerManager graffController];
		UITabBarController *tab = delegate.tabBarController;
&nbsp;
		[tab.view removeFromSuperview];
		UIView *win = delegate.window;
		[win addSubview:graff.view];
&nbsp;
		[win.layer addAnimation:animation forKey:nil];
&nbsp;
	}
    return NO;
}</pre></td></tr></table></div>

<br />
<br />
アニメーションでFade in out させて別画面を起動させています。<br />
最後にNOをreturnしているのは、呼び出し元画面を自動回転させないため。<br />
あくまで横向き時に別画面を呼び出すことにとどめています。<br />
<h3>横向き画面用に座標を変換</h3>
上の状態では画面を起動することはできますが、座標がホームボタンの左上になっているため、こんな画面になってしまいます。<br />
<br />
<a href="http://iphone.longearth.net/wp-content/uploads/2009/04/picture-2.png"><img class="alignnone size-medium wp-image-480" title="横向きになりきれていない" src="http://iphone.longearth.net/wp-content/uploads/2009/04/picture-2-300x161.png" alt="横向きになりきれていない" width="300" height="161" /></a><br />
<br />
背景画像も横向きサイズで用意したため、見事に縦に足りず、横にはみ出ています。<br />
<br />
まずはViewのframeを横向きサイズに変更します。<br />
ここでは呼び出し先のloadViewメソッドでframeを指定します。<br />
<br />

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p474code9'); return false;">View Code</a> OBJECTIVE-C</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p4749"><td class="code" id="p474code9"><pre class="objective-c" style="font-family:monospace;">- (void)loadView {
	CGRect frame = [[UIScreen mainScreen] applicationFrame];
	UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, frame.size.height, frame.size.width)];
	view.autoresizesSubviews = YES;
	self.view = view;
	[view release];
}</pre></td></tr></table></div>

<br />
<br />
Interface Builderを使用している場合は、IB上でframeを横向きサイズに指定しておきます。<br />
<br />
これで呼び出し先のビューでdrawRectしている内容も横向きサイズ内で描画されるようになります。こんな感じ。<br />
<br />
<a href="http://iphone.longearth.net/wp-content/uploads/2009/04/picture-3.png"><img class="alignnone size-medium wp-image-482" title="横向きフレーム補正" src="http://iphone.longearth.net/wp-content/uploads/2009/04/picture-3-300x161.png" alt="横向きフレーム補正" width="300" height="161" /></a><br />
<br />
次に、左下になっているUIViewの原点を横向きにした時に左上にくるように座標を変換します。<br />
座標の変換にはCGAffineTransformを使います。<br />
<br />
コードからみてしまうとこんな感じ<br />
<br />

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p474code10'); return false;">View Code</a> OBJECTIVE-C</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p47410"><td class="code" id="p474code10"><pre class="objective-c" style="font-family:monospace;">- (void)viewWillAppear:(BOOL)animated {
	CGAffineTransform transform = CGAffineTransformMakeRotation(M_PI * 90 / 180.0f);
	transform = CGAffineTransformTranslate(transform, 80, 80);
	self.view.transform = transform;
}</pre></td></tr></table></div>

<br />
<br />
CGAffineTransformMakeRotationで引数にM_PI * 90 / 180.0fを与えていますが、こいつで座標を時計回りに90°回転させています。<br />
ちなみに90°回転させた状態はこんな感じになります。<br />
<br />
<a href="http://iphone.longearth.net/wp-content/uploads/2009/04/picture-5.png"><img class="alignnone size-medium wp-image-486" title="90°回転" src="http://iphone.longearth.net/wp-content/uploads/2009/04/picture-5-300x161.png" alt="90°回転" width="300" height="161" /></a><br />
<br />
どうも回転は描画前のcenterを中心に行われるようです。たぶん。<br />
<br />
次のCGAffineTransformTranslateで描画位置を移動させます。<br />
ここではx軸に80px,y軸に80px移動させます。<br />
x軸は右が、y軸は下が正の値です。<br />
<br />
これをすると左上にずれてしまっているviewが右下に移動してこの形になります。<br />
<br />
<a href="http://iphone.longearth.net/wp-content/uploads/2009/04/picture-6.png"><img class="alignnone size-medium wp-image-487" title="横向き正常" src="http://iphone.longearth.net/wp-content/uploads/2009/04/picture-6-300x161.png" alt="横向き正常" width="300" height="161" /></a><br />
<br />
ですが、このままでは反対の横に回転させるとこんな画面になってしまいます。<br />
<br />
<a href="http://iphone.longearth.net/wp-content/uploads/2009/04/picture-7.png"><img class="alignnone size-medium wp-image-488" title="横向き反対" src="http://iphone.longearth.net/wp-content/uploads/2009/04/picture-7-300x161.png" alt="横向き反対" width="300" height="161" /></a><br />
<br />
今は、呼び出し元画面時に左右どちらに傾けようが、常に時計周りに座標を変換してしまっているためです。<br />
<br />
なので呼び出し元での傾ける方向を呼び出し先画面に渡して、その値によって傾ける方向を変えてやります。<br />
<br />
呼び出し元のコードは以下。<br />
<br />

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p474code11'); return false;">View Code</a> OBJECTIVE-C</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p47411"><td class="code" id="p474code11"><pre class="objective-c" style="font-family:monospace;"> - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
       //ホームボタンが下以外にある状態なら
 	if (UIInterfaceOrientationPortrait != interfaceOrientation){
&nbsp;
		iPachiAppDelegate *delegate = (iPachiAppDelegate *)[[UIApplication sharedApplication] delegate];
&nbsp;
               // Fade In Out のアニメーションで表示
		CATransition* animation;
		animation = [CATransition animation];
		animation.type = kCATransitionFade;
&nbsp;
		[[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES];
&nbsp;
		GraffController *graff = [ControllerManager graffController];
&nbsp;
　　　　 // 画面の向きを渡す
　　　　 graff.parentUIInterfaceOrientation = interfaceOrientation;
&nbsp;
		UITabBarController *tab = delegate.tabBarController;
&nbsp;
		[tab.view removeFromSuperview];
		UIView *win = delegate.window;
		[win addSubview:graff.view];
&nbsp;
		[win.layer addAnimation:animation forKey:nil];
&nbsp;
	}
    return NO;
}</pre></td></tr></table></div>

<br />
<br />
呼び出し先のコードは以下。<br />
<br />

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p474code12'); return false;">View Code</a> OBJECTIVE-C</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p47412"><td class="code" id="p474code12"><pre class="objective-c" style="font-family:monospace;">- (void)viewWillAppear:(BOOL)animated {
       // 右にホームボタンがある場合
	if (self.parentUIInterfaceOrientation == UIInterfaceOrientationLandscapeRight ){
　　　　// 90°時計回りに回転
		CGAffineTransform transform = CGAffineTransformMakeRotation(M_PI * 90 / 180.0f);
		transform = CGAffineTransformTranslate(transform, 80, 80);
		self.view.transform = transform;	
&nbsp;
       // 左にホームボタンがある場合
	} else if (self.parentUIInterfaceOrientation == UIInterfaceOrientationLandscapeLeft ){
　　　　// 90°半時計回りに回転
		CGAffineTransform transform = CGAffineTransformMakeRotation(M_PI * 270 / 180.0f);
		transform = CGAffineTransformTranslate(transform, -80, -80);
		self.view.transform = transform;
	}
}</pre></td></tr></table></div>

<br />
<br />
呼び出し先にはこんな変数を定義しています。<br />
UIInterfaceOrientation parentUIInterfaceOrientation;<br />
<br />
ここまでで、横向き起動完了です。<br />
<br />
おつかれさまです。<br />
<br />
<h3>関連のあるアプリ</h3>
<div style="float:left; margin-right:10px; margin-bottom:10px">
<a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=307729455&amp;mt=8"><img src="http://iphone.longearth.net/wp-content/uploads/2008/12/islot_icon.png" alt="islot_icon" title="islot_icon" width="57" height="57" class="alignnone size-full wp-image-502" /></a><br />
</div>
<div style="float:left">
<a href="http://iphone.longearth.net/2009/03/14/%E3%80%90app-store%E3%80%91iphone%E3%81%A7%E6%A9%9F%E4%BC%9A%E5%89%B2%E7%AE%97%E5%87%BA%E3%81%8C%E3%81%A7%E3%81%8D%E3%82%8B%E3%83%91%E3%83%81%E3%82%B9%E3%83%AD%E5%8F%8E%E6%94%AF%E7%AE%A1%E7%90%86/">iSlot Pro</a> 2009/03/13 リリース<br />
ファイナンス　350円<br />
パチスロ収支管理アプリ<br />
</div>
<div style="float:right">
<a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=307729455&amp;mt=8"><img src="http://iphone.longearth.net/wp-content/uploads/2008/12/app_store_badge.png" alt="app_store_badge" title="app_store_badge" width="157" height="57" class="alignnone size-full wp-image-505" /></a><br />
</div>
<div style="clear:both"></div></p>

	<p>タグ: <a href="http://iphone.longearth.net/tag/interface-builder/" title="Interface Builder" rel="tag nofollow">Interface Builder</a>, <a href="http://iphone.longearth.net/tag/ipachi/" title="iPachi" rel="tag nofollow">iPachi</a>, <a href="http://iphone.longearth.net/tag/iphone/" title="iphone" rel="tag nofollow">iphone</a>, <a href="http://iphone.longearth.net/tag/islot/" title="iSlot" rel="tag nofollow">iSlot</a>, <a href="http://iphone.longearth.net/tag/islot-pro/" title="iSlot Pro" rel="tag nofollow">iSlot Pro</a>, <a href="http://iphone.longearth.net/tag/objecti/" title="objecti" rel="tag nofollow">objecti</a>, <a href="http://iphone.longearth.net/tag/objective-c/" title="objective-c" rel="tag nofollow">objective-c</a>, <a href="http://iphone.longearth.net/tag/uiviewcontroller/" title="UIViewController" rel="tag nofollow">UIViewController</a>, <a href="http://iphone.longearth.net/tag/%e3%82%a2%e3%83%97%e3%83%aa/" title="アプリ" rel="tag nofollow">アプリ</a>, <a href="http://iphone.longearth.net/tag/%e3%83%91%e3%83%81%e3%82%b9%e3%83%ad/" title="パチスロ" rel="tag nofollow">パチスロ</a>, <a href="http://iphone.longearth.net/tag/%e3%83%aa%e3%83%aa%e3%83%bc%e3%82%b9/" title="リリース" rel="tag nofollow">リリース</a>, <a href="http://iphone.longearth.net/tag/%e5%8f%8e%e6%94%af/" title="収支" rel="tag nofollow">収支</a>, <a href="http://iphone.longearth.net/tag/%e5%9b%9e%e8%bb%a2/" title="回転" rel="tag nofollow">回転</a>, <a href="http://iphone.longearth.net/tag/%e5%a4%89%e6%8f%9b/" title="変換" rel="tag nofollow">変換</a>, <a href="http://iphone.longearth.net/tag/%e6%a4%9c%e7%9f%a5/" title="検知" rel="tag nofollow">検知</a>, <a href="http://iphone.longearth.net/tag/%e6%a8%aa%e5%90%91%e3%81%8d/" title="横向き" rel="tag nofollow">横向き</a></p>

	<h4>関連する投稿</h4>
	<ul class="st-related-posts">
	<li><a href="http://iphone.longearth.net/2009/01/19/%e3%80%90uitableview%e3%80%91%e9%81%b8%e6%8a%9e%e8%a1%8c%e3%81%8b%e3%82%89%e5%88%a5%e7%94%bb%e9%9d%a2%e3%82%92%e5%91%bc%e3%81%b3%e5%87%ba%e3%81%99/" title="【UITableView】選択行から別画面を呼び出す (2009 年 1 月 19 日)">【UITableView】選択行から別画面を呼び出す</a> </li>
	<li><a href="http://iphone.longearth.net/2009/01/20/%e3%80%90uitableview%e3%80%91uitableview%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e8%a9%b3%e7%b4%b0%e7%94%bb%e9%9d%a2%e3%82%92%e4%bd%9c%e3%82%8b-1%e3%80%90uitableviewdatasource%e3%80%91/" title="【UITableView】UITableViewを使って詳細画面を作る-1【UITableViewDataSource】 (2009 年 1 月 20 日)">【UITableView】UITableViewを使って詳細画面を作る-1【UITableViewDataSource】</a> </li>
	<li><a href="http://iphone.longearth.net/2009/02/26/%e3%80%90uitableview%e3%80%91grouped%e3%81%aa%e3%83%86%e3%83%bc%e3%83%96%e3%83%ab%e3%81%ae%e3%82%b9%e3%82%af%e3%83%ad%e3%83%bc%e3%83%ab%e3%81%8c%e9%87%8d%e3%81%84/" title="【UITableView】Groupedなテーブルのスクロールが重い (2009 年 2 月 26 日)">【UITableView】Groupedなテーブルのスクロールが重い</a> </li>
	<li><a href="http://iphone.longearth.net/2009/03/09/%e3%80%90iphone%e3%80%91%e3%83%a1%e3%83%a2%e3%83%aa%e4%b8%8d%e8%b6%b3%e6%99%82%e3%81%ae%e3%82%b7%e3%83%9f%e3%83%a5%e3%83%ac%e3%83%bc%e3%83%88%e3%81%a8%e3%83%87%e3%83%90%e3%83%83%e3%82%b0/" title="【iPhone】メモリ不足時のシミュレートとデバッグ (2009 年 3 月 9 日)">【iPhone】メモリ不足時のシミュレートとデバッグ</a> </li>
	<li><a href="http://iphone.longearth.net/2009/05/09/%e3%82%a2%e3%83%97%e3%83%aa%e3%82%92iphone-os-30%e3%81%b8%e5%af%be%e5%bf%9c%e3%81%95%e3%81%9b%e3%82%8b%e6%99%82%e3%81%8c%e3%81%8d%e3%81%be%e3%81%97%e3%81%9f/" title="アプリをiPhone OS 3.0へ対応させる時がきました (2009 年 5 月 9 日)">アプリをiPhone OS 3.0へ対応させる時がきました</a> </li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://iphone.longearth.net/2009/04/07/%e3%80%90uiviewcontroller%e3%80%91iphone%e3%82%92%e6%a8%aa%e5%90%91%e3%81%8d%e3%81%ab%e3%81%97%e3%81%9f%e6%99%82%e3%81%ab%e5%88%a5%e7%94%bb%e9%9d%a2%e3%82%92%e8%a1%a8%e7%a4%ba%e3%81%99%e3%82%8b/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
