<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: iPhone accelerometer and device orientation</title>
	<atom:link href="http://blog.sallarp.com/iphone-accelerometer-device-orientation/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sallarp.com/iphone-accelerometer-device-orientation/</link>
	<description>Code, Code, Revolution!</description>
	<lastBuildDate>Wed, 28 Jul 2010 23:26:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Suman</title>
		<link>http://blog.sallarp.com/iphone-accelerometer-device-orientation/comment-page-1/#comment-8949</link>
		<dc:creator>Suman</dc:creator>
		<pubDate>Mon, 29 Mar 2010 09:14:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sallarp.com/?p=573#comment-8949</guid>
		<description>hi there, i am very much inspired by your &quot;ScrollViewImageGallery&quot; example. I would want to add 2 more functionalities - a tile based home page, where i have 16 buttons to press which will lead different groups. I want to create a scrap with lots of pictures.

Second is to add Tab bar to this gallery. Can you guide me how to do this? Thanks a ton.</description>
		<content:encoded><![CDATA[<p>hi there, i am very much inspired by your &#8220;ScrollViewImageGallery&#8221; example. I would want to add 2 more functionalities &#8211; a tile based home page, where i have 16 buttons to press which will lead different groups. I want to create a scrap with lots of pictures.</p>
<p>Second is to add Tab bar to this gallery. Can you guide me how to do this? Thanks a ton.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lars</title>
		<link>http://blog.sallarp.com/iphone-accelerometer-device-orientation/comment-page-1/#comment-7491</link>
		<dc:creator>Lars</dc:creator>
		<pubDate>Tue, 09 Feb 2010 13:51:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sallarp.com/?p=573#comment-7491</guid>
		<description>Aha, now after having a closer look at your &quot;ScrollViewImageGallery&quot; example, I see how to add a view controller dynamically! Thank you very much for all the comments, very useful.

Kind regards, Lars</description>
		<content:encoded><![CDATA[<p>Aha, now after having a closer look at your &#8220;ScrollViewImageGallery&#8221; example, I see how to add a view controller dynamically! Thank you very much for all the comments, very useful.</p>
<p>Kind regards, Lars</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lars</title>
		<link>http://blog.sallarp.com/iphone-accelerometer-device-orientation/comment-page-1/#comment-7489</link>
		<dc:creator>Lars</dc:creator>
		<pubDate>Tue, 09 Feb 2010 12:57:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sallarp.com/?p=573#comment-7489</guid>
		<description>Hei Björn, Takk skal du ha! (15 months in Norway, but this is pretty much all I can say in Norwegian, sorry ;-)

Thank you very much indeed for your excellent sample code and all the great examples which are extremely useful for iPhone development beginners like myself.

As I can see from your sample code, the orientation determination always starts when the first view is already added to the window as a subview. Is there a way of starting earlier? Actually I do not like Apple&#039;s approach to start all applications in Portrait Orientation first and only then switch to Landscape Orientation if necessary.

If I hold my iPhone already in Landscape Orientation and start an app or safari (yes, I know, I shouldn&#039;t), it will show Portrait Orientation first and switch directly to Landscape Orientation afterwards. I would like to prevent this animated orientation switch entirely and start right away with the &quot;correct&quot; orientation of the app accordingly to the device&#039;s physical orientation (yes, I saw your discussion on flipping the whole app&#039;s or just the view orientation of the image view).

This is a minor issue with the iPhone since the UI of the springboard is not (yet) available in landscape orientation anyway, but rather soon it will be more important, because - even Apple admits - one cannot predict the &quot;user preferred orientation&quot; anymore when it comes to the iPad.

So, can I already start with this accelerometer determination at the point of &quot;applicationDidFinishLaunching&quot;? I would like to determine the necessary view orientation first (accordingly to the physical orientation of the device) and only then add the respective (portrait or landscape) view controller and view as a subview to the window.

How would I add a view controller dynamically then (sorry, I am still a beginner)?

Since I do not love too much this animated rotation of the views, I would rather like to use something which is shown in Apple&#039;s AlternateViews example and to have this quick and neat cross-dissolve effect instead.

Thanks again for your helpful blog and those great insights.

Kind regards from Berlin, Lars</description>
		<content:encoded><![CDATA[<p>Hei Björn, Takk skal du ha! (15 months in Norway, but this is pretty much all I can say in Norwegian, sorry <img src='http://blog.sallarp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Thank you very much indeed for your excellent sample code and all the great examples which are extremely useful for iPhone development beginners like myself.</p>
<p>As I can see from your sample code, the orientation determination always starts when the first view is already added to the window as a subview. Is there a way of starting earlier? Actually I do not like Apple&#8217;s approach to start all applications in Portrait Orientation first and only then switch to Landscape Orientation if necessary.</p>
<p>If I hold my iPhone already in Landscape Orientation and start an app or safari (yes, I know, I shouldn&#8217;t), it will show Portrait Orientation first and switch directly to Landscape Orientation afterwards. I would like to prevent this animated orientation switch entirely and start right away with the &#8220;correct&#8221; orientation of the app accordingly to the device&#8217;s physical orientation (yes, I saw your discussion on flipping the whole app&#8217;s or just the view orientation of the image view).</p>
<p>This is a minor issue with the iPhone since the UI of the springboard is not (yet) available in landscape orientation anyway, but rather soon it will be more important, because &#8211; even Apple admits &#8211; one cannot predict the &#8220;user preferred orientation&#8221; anymore when it comes to the iPad.</p>
<p>So, can I already start with this accelerometer determination at the point of &#8220;applicationDidFinishLaunching&#8221;? I would like to determine the necessary view orientation first (accordingly to the physical orientation of the device) and only then add the respective (portrait or landscape) view controller and view as a subview to the window.</p>
<p>How would I add a view controller dynamically then (sorry, I am still a beginner)?</p>
<p>Since I do not love too much this animated rotation of the views, I would rather like to use something which is shown in Apple&#8217;s AlternateViews example and to have this quick and neat cross-dissolve effect instead.</p>
<p>Thanks again for your helpful blog and those great insights.</p>
<p>Kind regards from Berlin, Lars</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shawn Brinkman</title>
		<link>http://blog.sallarp.com/iphone-accelerometer-device-orientation/comment-page-1/#comment-7441</link>
		<dc:creator>Shawn Brinkman</dc:creator>
		<pubDate>Fri, 05 Feb 2010 20:24:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sallarp.com/?p=573#comment-7441</guid>
		<description>I get this build error when tring to run the project.
error: There is no SDK with the name or path &#039;iphoneos2.0&#039;

Can you please help me .

Thank you
Shawn</description>
		<content:encoded><![CDATA[<p>I get this build error when tring to run the project.<br />
error: There is no SDK with the name or path &#8216;iphoneos2.0&#8242;</p>
<p>Can you please help me .</p>
<p>Thank you<br />
Shawn</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bo Gehring</title>
		<link>http://blog.sallarp.com/iphone-accelerometer-device-orientation/comment-page-1/#comment-4313</link>
		<dc:creator>Bo Gehring</dc:creator>
		<pubDate>Fri, 02 Oct 2009 13:00:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sallarp.com/?p=573#comment-4313</guid>
		<description>This is a great blog!  A question... these solutions appear to be for yaw only.  Is it possible to derive pitch and roll too?  That would fully describe the device&#039;s orientation.</description>
		<content:encoded><![CDATA[<p>This is a great blog!  A question&#8230; these solutions appear to be for yaw only.  Is it possible to derive pitch and roll too?  That would fully describe the device&#8217;s orientation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joel Morris</title>
		<link>http://blog.sallarp.com/iphone-accelerometer-device-orientation/comment-page-1/#comment-2392</link>
		<dc:creator>Joel Morris</dc:creator>
		<pubDate>Mon, 22 Jun 2009 06:05:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sallarp.com/?p=573#comment-2392</guid>
		<description>Also, the file which defines atan2() also has a bunch of constants defined like M_PI  M_PI_2 (pi/2) and M_PI_4 (pi/4)  I think your code could be a tiny bit more accurate if you used these instead.</description>
		<content:encoded><![CDATA[<p>Also, the file which defines atan2() also has a bunch of constants defined like M_PI  M_PI_2 (pi/2) and M_PI_4 (pi/4)  I think your code could be a tiny bit more accurate if you used these instead.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: OS3.0のshouldAutorotateTo-InterfaceOrientationがおかしい件 &#124; iphoneアプリで稼げるのか</title>
		<link>http://blog.sallarp.com/iphone-accelerometer-device-orientation/comment-page-1/#comment-2292</link>
		<dc:creator>OS3.0のshouldAutorotateTo-InterfaceOrientationがおかしい件 &#124; iphoneアプリで稼げるのか</dc:creator>
		<pubDate>Thu, 18 Jun 2009 16:43:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sallarp.com/?p=573#comment-2292</guid>
		<description>[...] 似たような現象に遭遇してる人がいたので、めちゃめちゃ参考にしてます。 iPhone OS 3.0 &#8211; Breaking changes to shouldAutorotateToInterfaceOrientation &#124; blog.sallarp.com Find the device orientation using the accelerometer &#124; blog.sallarp.com [...]</description>
		<content:encoded><![CDATA[<p>[...] 似たような現象に遭遇してる人がいたので、めちゃめちゃ参考にしてます。 iPhone OS 3.0 &#8211; Breaking changes to shouldAutorotateToInterfaceOrientation | blog.sallarp.com Find the device orientation using the accelerometer | blog.sallarp.com [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Björn Sållarp</title>
		<link>http://blog.sallarp.com/iphone-accelerometer-device-orientation/comment-page-1/#comment-1335</link>
		<dc:creator>Björn Sållarp</dc:creator>
		<pubDate>Tue, 19 May 2009 06:18:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sallarp.com/?p=573#comment-1335</guid>
		<description>Adrian,

Very true, I&#039;ve updated the post. Thanks!</description>
		<content:encoded><![CDATA[<p>Adrian,</p>
<p>Very true, I&#8217;ve updated the post. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Björn Sållarp</title>
		<link>http://blog.sallarp.com/iphone-accelerometer-device-orientation/comment-page-1/#comment-1334</link>
		<dc:creator>Björn Sållarp</dc:creator>
		<pubDate>Tue, 19 May 2009 06:17:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sallarp.com/?p=573#comment-1334</guid>
		<description>Hey Kyle,

Awesome code! That does give access to the shouldAutorotateToInterfaceOrientation event! Thanks a lot. I&#039;ll update my other post later with your solution.</description>
		<content:encoded><![CDATA[<p>Hey Kyle,</p>
<p>Awesome code! That does give access to the shouldAutorotateToInterfaceOrientation event! Thanks a lot. I&#8217;ll update my other post later with your solution.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kyle</title>
		<link>http://blog.sallarp.com/iphone-accelerometer-device-orientation/comment-page-1/#comment-1330</link>
		<dc:creator>Kyle</dc:creator>
		<pubDate>Tue, 19 May 2009 04:24:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sallarp.com/?p=573#comment-1330</guid>
		<description>Not sure if I am allow to post code but here&#039;s some code for those who are curious:

-(void) viewWillAppear: (BOOL) animated{
  
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
  
[[NSNotificationCenter defaultCenter] addObserver: self 
   selector: @selector(receivedRotate:)   
   name: UIDeviceOrientationDidChangeNotification
   object: nil];
...
}

-(void) receivedRotate: (NSNotification*) notification
{
  UIDeviceOrientation interfaceOrientation = [[UIDevice currentDevice] orientation];
  if(interfaceOrientation == UIInterfaceOrientationLandscapeLeft)
  {
     ...
   }
}

-(void) viewWillDisappear: (BOOL) animated{
  [[NSNotificationCenter defaultCenter] removeObserver: self];
  [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
 ...
}</description>
		<content:encoded><![CDATA[<p>Not sure if I am allow to post code but here&#8217;s some code for those who are curious:</p>
<p>-(void) viewWillAppear: (BOOL) animated{</p>
<p>[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];</p>
<p>[[NSNotificationCenter defaultCenter] addObserver: self<br />
   selector: @selector(receivedRotate:)<br />
   name: UIDeviceOrientationDidChangeNotification<br />
   object: nil];<br />
&#8230;<br />
}</p>
<p>-(void) receivedRotate: (NSNotification*) notification<br />
{<br />
  UIDeviceOrientation interfaceOrientation = [[UIDevice currentDevice] orientation];<br />
  if(interfaceOrientation == UIInterfaceOrientationLandscapeLeft)<br />
  {<br />
     &#8230;<br />
   }<br />
}</p>
<p>-(void) viewWillDisappear: (BOOL) animated{<br />
  [[NSNotificationCenter defaultCenter] removeObserver: self];<br />
  [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];<br />
 &#8230;<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)

Served from: blog.sallarp.com @ 2010-07-30 17:21:36 -->