iOS orientation initiation unknown

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bakuraace
Posts: 2
Joined: Thu Mar 06, 2014 2:52 am

iOS orientation initiation unknown

Post by bakuraace » Thu Mar 06, 2014 3:00 am

Trying to learn some iOS specific stuff with mobile apps.

I have created a simple app to help me debug and understand what is happening behind the code. So far I have a stack that waits for a message orientationChanged to update the stack when the user rotates his/her device.

However I am struggling due to the fact that the simulator (haven't tried on a device yet) doesn't seem to be able to recognize the orientation before the app gets going. It would be cleaner I think to have the app orientation predetermined by the current orientation of the users device... All I get right now is a declaration of "unknown" instead of "landscape left" for example. Only happens when app is first started up.

Any help is appreciated. :-)

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: iOS orientation initiation unknown

Post by Mark » Sat Mar 08, 2014 3:25 pm

Hi,

I ran into the same problem and I decided to write a blog post about my solution. It has become a brief tutorial. You can read it here.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

bakuraace
Posts: 2
Joined: Thu Mar 06, 2014 2:52 am

Re: iOS orientation initiation unknown

Post by bakuraace » Sun Mar 09, 2014 4:47 am

I will give the acceleration functionality a try when I can... Hope that it does the trick... I've kept trying to keep the unknown response for orientation from causing problems by using conditional statements and making assumptions but even that isn't working out for me.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: iOS orientation initiation unknown

Post by Mark » Sun Mar 09, 2014 12:34 pm

Hi,

Reading your question again, I understand that you want to know the current orientation rather than the change from the previous orientation. My tutorial is about changing the position of the device rather than it's current position.

Perhaps your problem is in the simulator. Have you tried this on a real device already?

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply