Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

iOS and MacOS / Can't use iOS interpreter to make a landscape app

Author
Message
God of Thunder
14
Years of Service
User Offline
Joined: 17th Dec 2007
Location: Middle of nowhere, Australia
Posted: 4th Oct 2012 08:27
I am really lost ... all i want to do is set my simple app made in tier 1 BASIC ... using the interpreter for iOS to display in a landscape view on the iOS simulator ... just cant seem to get it it ... my entire code is as follows



I am using Xcode 4.5.1
and the iOS 6 simulator

This is really annoying me ... probably something so obvious ... but i just cant get it

Only those who have been through Hell can see Heaven.
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th Oct 2012 17:06 Edited at: 4th Oct 2012 17:08
There are a couple of other steps to take.

The first is to set the Supported Interface Orientations in both the iPhone/iPod and iPad sections under Summary (for the TARGETS-><yourproj> in the Xcode interface to the two landscape modes (make sure the portrait ones are not set).

Using SetDisplayAspect is for the percentage system. If you plan to keep using the percentage system, that is fine. Otherwise, drop that statement and use SetVirtualResolution.

Another step is to add this to the <yourproj>-Info.plist file in <yourproj> directory:


The plist edit should set the initial orientation to the Landscape Right. If you'd rather start in the other landscape mode, change 'Right' for 'Left'.

EDIT: Also, make sure to have a Default-Landscape.png image so that the app has something to display properly. You can also make your Default.png to be your landscape image rotated (so that when displayed in portrait mode it looks like the app is tilted).

Cheers,
Ancient Lady
AGK Community Tester
God of Thunder
14
Years of Service
User Offline
Joined: 17th Dec 2007
Location: Middle of nowhere, Australia
Posted: 4th Oct 2012 23:35
Thanx heaps for the reply Ancient Lady

I set the the supported interface Orientations to landscape left and right

i added


to the end of Info.plist

and lastly i created a Default-Landscape.png and added it to my project.

Unfortunately this has made no difference to my issue. Most likely i have followed something incorrectly.

Any Ideas would be greatly appreciated

Only those who have been through Hell can see Heaven.
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 5th Oct 2012 00:56
I'll assume that you cleaned and rebuilt your app after making the changes. You should also need to close the project while editing the <project>-Info.plist file and then reopen it to make sure it applies.

Also, try replacing "SetDisplayAspect(4.0/ 3.0)" with "SetVirtualResolution(960,680)" (or whatever resolution you made your landscape image for), rebuild in the AppGameKit IDE, copy the media/<yourproj>.byc to your mac (and rename) to <yourproj>/media/bytecode.byc. Then rebuild the Xcode project and try again.

Are you sure you have version 1076 set up on your Mac?

If the shouldAutorotateToInterfaceOrientation method in Classes/UntitledViewController.m doesn't look like this, then you don't have the updated version:


If the method does look like that, switch the 3 and 4 (AGK and Apple have different ideas about which way the landscape orientations go). Clean, rebuild and run again.

Cheers,
Ancient Lady
AGK Community Tester
God of Thunder
14
Years of Service
User Offline
Joined: 17th Dec 2007
Location: Middle of nowhere, Australia
Posted: 5th Oct 2012 06:25
I seem to have version 1076 as UntitledViewController.m looks like that.

I replaced SetDisplayAspect with SetVirtualResolution ... retransfered my byte code ... cleaned .. built ... tried again... same problem.

switched case 3 and 4 in UntitledViewController.m ... cleaned ... built ... tried again ... no luck .... really annoying.

I really have no idea what could be causing the issue .... should not be hard to make an app for landscape ... I feel like an idiot.

Thanx again for for your patience ... I regret having to ask for further help ... but I'm stumped ... been trying to solve this for over a day now.

Only those who have been through Hell can see Heaven.
God of Thunder
14
Years of Service
User Offline
Joined: 17th Dec 2007
Location: Middle of nowhere, Australia
Posted: 5th Oct 2012 08:12
I seem to have version 1076 as UntitledViewController.m is as you described

I tried changing SetDisplayAspect to SetVirtual Resolution.

I tried witching case 3 and 4

No luck yet

downloading iOS simulator 5.1 atm ... maybe an issue on 6.0 ... I dunno
worth a shot

Only those who have been through Hell can see Heaven.
God of Thunder
14
Years of Service
User Offline
Joined: 17th Dec 2007
Location: Middle of nowhere, Australia
Posted: 5th Oct 2012 12:25
Well this is weird ... works as intended using the iOS 5.1 Simulator

Anyone else having issues like this with the iOS 6.0 Simulator?

Only those who have been through Hell can see Heaven.
bjadams
AGK Backer
14
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 5th Oct 2012 12:52
Apple has just released a new Xcode update last day.
try your luck updating to that one
God of Thunder
14
Years of Service
User Offline
Joined: 17th Dec 2007
Location: Middle of nowhere, Australia
Posted: 5th Oct 2012 13:03
Unfortunately my Xcode is up to date.

5.1 works fine ... still trying to figure out whats happening on 6.0

Only those who have been through Hell can see Heaven.
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 5th Oct 2012 16:21
I just tried my Tier 1 landscape app in both the 5.1 simulator and the 6.0 simulator. It worked fine in the 5.1 one, but not in the 6.0 one.

But it did work fine on my iOS 6.0 device.

So, the issue appears to be with the iOS 6.0 simulator.

And, yes, I too am running the latest Xcode.

Running a test for someone else, I discovered that both the simulators had some issue with text from Print command. But that the same apps worked perfectly on real devices.

I'd say that the simulators are not quite perfect.

Ultimately, God of Thunder, the issue appears to be the simulator itself and not the code. I'd trust the 5.1 simulator. I don't think the AppGameKit code does anything that would not work in iOS 6.0.

Cheers,
Ancient Lady
AGK Community Tester
bjadams
AGK Backer
14
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 5th Oct 2012 22:35
I never use the simulator, it's pretty slow
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 5th Oct 2012 22:41
I only use the simulators when doing Community Tester stuff, as a first cut before I try it on my actual devices.

Cheers,
Ancient Lady
AGK Community Tester
God of Thunder
14
Years of Service
User Offline
Joined: 17th Dec 2007
Location: Middle of nowhere, Australia
Posted: 6th Oct 2012 01:12
I only just bought my mac and iOS developer enrolment.

BTW ... Macs' rock ... lol ... i prefer Xcode over Visual Studio

Once i get my certificates i'll be testing on my actual devices.

I really do appreciate the time put aside to help me with this issue.

Thanx again ppl

Only those who have been through Hell can see Heaven.
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 6th Oct 2012 04:09
Make sure to replace the files in the template_xcode4/Classes directory with the ones from this post.

All of the Tier 2 templates are out of date.

If you use the ones from my post, also replace the template.h and template.cpp files with the ones in that post.

Then you have access to the function that lets you know when your app has returned from being sent to the background by another app.

The xcode template in the post also has a fix for getting AppGameKit and iOS to agree on which direction the two landscape orientations are.

Cheers,
Ancient Lady
AGK Community Tester
God of Thunder
14
Years of Service
User Offline
Joined: 17th Dec 2007
Location: Middle of nowhere, Australia
Posted: 6th Oct 2012 14:49
Thanx Ancient Lady

That will be sweet when i step into tier 2 .... next project i hope

Only those who have been through Hell can see Heaven.
bjadams
AGK Backer
14
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 6th Oct 2012 18:40
anyone tried the new v108

are the templates still out of date?

or can i still use the old templates?
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 6th Oct 2012 18:57
v108 has no templates at all.

As promised (threatened) they did away with templates and proviced a guide to create your own template from the interpreter_<platform> projects.

I haven't tried it yet.

People are already reporting issues with missing include files and the interpreter_ios Xcode project is reporting that it is missing two base SDKs (libGoogleAdMobAds.a and libOAuth.a).

I'm going to put v108 beta alongside my working v1076 and test some stuff and see if I can get anything to work.

Cheers,
Ancient Lady
AGK Community Tester
Impetus73
11
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 7th Oct 2012 14:58 Edited at: 7th Oct 2012 14:58
I have the same orientation issue... I made a landscape app using virtual resolution, and when I run it in the iOS 5.1 simulator, it's correct. If I run it in the iOS 6 simulator, AND on the iPad with iOS 6 installed, the picture is in portrait, and stretched to fill the screen. When I press the screen, the coordinates of the press, is off.

I'm using OS X 10.7.5 with Xcode 4.5 and iPad with iOS 6

----------------
AGK programmer
Did Amiga / AMOS programming in the 90's.
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 7th Oct 2012 18:12
Impetus73, are you using Tier 1 or Tier 2? And do you have all the settings set in Xcode for landscape only?

The iOS 6.0 simulator does have a problem. But I haven't had a problem with my actual iOS 6.0 device.

Can you show your setup code?

Cheers,
Ancient Lady
AGK Community Tester
Impetus73
11
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 7th Oct 2012 21:49
I'm using Tier 1, and no matter what settings I use, it is tilted 90 degrees, and either stretch to the whole screen, or have big black borders on either side. When I run in the iOS 5.0 simulator, all is ok.

What setup code is that?

----------------
AGK programmer
Did Amiga / AMOS programming in the 90's.
Impetus73
11
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 7th Oct 2012 21:57 Edited at: 7th Oct 2012 22:01
I think we can say that any iOS 6 devices, is NOT compatible with AGK's orientation system. I can not get it to work on either iPhone 5 iOS 6 simulator, or iPad iOS 6.0 simulator or iPad iOS 6.0 physical devices.

A quick google, shows that almost any programming systems out there have issues with orientation and iOS 6, so I guess a fix will come soon.

----------------
AGK programmer
Did Amiga / AMOS programming in the 90's.
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 7th Oct 2012 22:30
iOS 6.0 is compatible on the actual device, if your setup and core AppGameKit code is correct. It is not quite so good on the iOS simulators.

The Xcode settings are for setting the allowed orientations. They are on the Summary page in two places, one for iPhone/iPod and the other for iPad.

See my first response in this thread for details.

Cheers,
Ancient Lady
AGK Community Tester
bjadams
AGK Backer
14
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 7th Oct 2012 22:59
So what about old landscape apps created with agk 1076 using old xcode 4 prior to ios6?

do they work properly on ios6?
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 7th Oct 2012 23:22
Yes, they do. I build my Xcode apps with either iOS 4.3 or iOS 5.1 as the target. That keeps things compatible.

Cheers,
Ancient Lady
AGK Community Tester
Impetus73
11
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 8th Oct 2012 15:23
Ancient Lady, can you make an example 1076 project, and .Zip it, and upload here, so I can test if it will work on my iPad with iOS 6.0 ? Include the whole application folder from the MAC setup please.

----------------
AGK programmer
Did Amiga / AMOS programming in the 90's.
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 8th Oct 2012 16:13
I don't have a simple landscape only Tier 1 app handy and don't really have the time right now to create one.

Attached is a Tier 2 project that does only one landscape orientation. It works on everything I test it on.

It has all the basic Xcode project information you need to make sure you have your project settings correct.

It won't compile for you unless you change all the code signing entries.

I have to test my landscape Tier 1 app in the simulators again to see if it is just a Tier 1 issue.

Cheers,
Ancient Lady
AGK Community Tester

Attachments

Login to view attachments
Impetus73
11
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 8th Oct 2012 20:40
I compiled the AppGameKit player, and when I send a Tier1 app to it, it has the same error, no way the device will display anything else than portait. No autorotate, no forced rotation setting possible. On Android all is ok.

I revert back to Xcode 4.3 until this is fixed...

----------------
AGK programmer
Did Amiga / AMOS programming in the 90's.
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 8th Oct 2012 21:46 Edited at: 8th Oct 2012 21:47
The player is a different beast altogether from running the application directly on a device.

You are not going to have a lot of success getting an app to run in only landscape orientation when run through the Player.

If you cannot get the app to behave the way you want when run directly on the device, then that is a different issue.

When you are building your iOS Player, are you sure that you have the proper v1076 files? If the shouldAutorotateToInterfaceOrientation method in your interpreter_ios/Classes/UntitledViewController.m file doesn't look like this, then you are using an old set of files (and probably libraries):


EDIT: And if it does look like that, switch the 3 and 4 and try again. Apple and AppGameKit have different ideas about which way each landscape mode goes, so there is a big conflict.


Cheers,
Ancient Lady
AGK Community Tester
Impetus73
11
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 8th Oct 2012 22:07
I reverted back to Xcode 4.4.1 and everything started to work again.

Xcode 4.5.1 changed the way orientation is adressed, so AppGameKit has to be rewritten to adapt to it. The "Old" methods were simply dropped, instead of being deprecated.

From the net:
Quote: "
in iOS6 the way orientation-changes are handled has been changed completly.

You need to implement supportedInterfaceOrientations for your viewControllers.
"


----------------
AGK programmer
Did Amiga / AMOS programming in the 90's.
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 8th Oct 2012 22:26 Edited at: 8th Oct 2012 22:27
Quote: "You need to implement supportedInterfaceOrientations for your viewControllers."


I've been having no issues with Landscape orientation with Tier 2.

But I just tested a Tier 1 app and it did have an issue with going into landscape orientation.

So, this is an issue for Tier 1 development and iOS 6.0. Not so much an issue with Xcode, except that Xcode 4.5 is set to work with iOS 6.0.

I will report the bug.

EDIT: And I can see where this is going to be an issue, since it only applies to iOS 6.0 and not iOS 5.1 and Tier 1.

Cheers,
Ancient Lady
AGK Community Tester
God of Thunder
14
Years of Service
User Offline
Joined: 17th Dec 2007
Location: Middle of nowhere, Australia
Posted: 12th Oct 2012 04:19
Just got my iPad updated to iOS 6.0 and unfortunately i'm having the same issues as i did within the simulator ... very very frustrating.

Only those who have been through Hell can see Heaven.
Impetus73
11
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 12th Oct 2012 16:37 Edited at: 12th Oct 2012 16:37
Yes, AppGameKit HAS to be rewritten, the old orientation routines in xcode, is changed in the latest SDK. I suspect that Ancient Lady is using an older base SDK, since she claim no problems with tier2. If you do a vanilla install of xcode 4.5.1 on a mac who had no earlier version of xcode, it will not work, since the base SDK then is 6.0 even if you'r compile target is for an earlier version.

I uninstalled xcode 4.5.1 and installed 4.4.1, and everything started to work again.

Edit: I'm using iOS 6.0 on the pad, and it works, if your using xcode 4.4.1

----------------
AGK programmer
Did Amiga / AMOS programming in the 90's.
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 12th Oct 2012 16:55
I didn't say no problems. I said I was able to get a player and bare bones template working. I haven't tried anything else yet. And I suspect there will be problems.

iOS 6.0 does some different things with respect to orientation changing.

I have two simple programs done in v1076, one in Tier 1 and the other Tier 2, that basically just show the orientation and screen size. Both work fine on my iOS 5.1 device. The Tier 2 one works on my iOS 6.0 device. But even though the Tier 1 one reports the correct orientation, it will not actually change orientation on the iOS 6.0 device.

I plan to try them both with v1082, when I get some free time (I need to work on some real stuff for a while).

Cheers,
Ancient Lady
AGK Community Tester
Impetus73
11
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 12th Oct 2012 17:47
My tier1 program also works on iOS 6.0, but not if I compile it using Xcode 4.5.1

I guess, since AppGameKit does not seem to demand iOS 6.0 SDK specific functions, we should all stick to Xcode 4.4.1 or less for now, and make a note about it in the AppGameKit documentation.

Ancient Lady, AppGameKit should seriously pay you a huge salary, your doing alot of work for them, and your tips and guides really helped me get a grip on iOS distribution!

----------------
AGK programmer
Did Amiga / AMOS programming in the 90's.
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 12th Oct 2012 17:58
Okay, I think I'll roll back to Xcode 4.4.1 and see if I get the same results. I'd hate to have issues with iOS 6.0 if I don't need them.

I'm betting the Xcode 4.5.1 is set to handle the 'new' methods in iOS 6.0 that were added for orientation stuff.

Quote: "AGK should seriously pay you a huge salary"

Don't I wish. I'd love to work for these guys. But they are in the UK and I am in the USA. It might be difficult. But I telecommute well. Sigh, nice dream.

Cheers,
Ancient Lady
AGK Community Tester
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 12th Oct 2012 20:21
I just rolled back to Xcode 4.4.1.

It took it a while, but it eventually recognized my iOS 6.0 iPad 2.

I rebuilt and installed the Tier 1 orientation display program and it worked just fine.

So, my recommendation is to definitely stick with Xcode 4.4.1.

Cheers,
Ancient Lady
AGK Community Tester
bjadams
AGK Backer
14
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 12th Oct 2012 23:37
We can't keep on sticking with 4.4.1 forever. iPad mini is going to be announced in the next 2 weeks, so I expect a new version of Xcode to support that
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 12th Oct 2012 23:52
True, but I wouldn't bet that AppGameKit will be ready for iPad mini soon, either.

We'll see how the AppGameKit developers go. They should fix it so that current Xcode works with current iOS. But that may be like trying to chase all the Windows versions (just try to run anything before XP in Windows 7, it ain't pretty).

Cheers,
Ancient Lady
AGK Community Tester
God of Thunder
14
Years of Service
User Offline
Joined: 17th Dec 2007
Location: Middle of nowhere, Australia
Posted: 13th Oct 2012 07:25
I rolled back to 4.4.1 and got my app working as intended ... for now i'm happy with using that method for my tier 1 apps.

Once i finish my current project and move onto the next one i will make the switch to tier 2.

Thanx to everyone here for helping me to not rip ALL my hair out

Only those who have been through Hell can see Heaven.

Login to post a reply

Server time is: 2022-09-29 13:31:22
Your offset time is: 2022-09-29 13:31:22