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 / iOS Xcode4 template problem

Author
Message
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 3rd Jun 2012 22:17
Final problem is trying to build something in Xcode4 from the xcode4 template. I saw a command in UntitledViewController.m that does not appear in Tier1 - agk::CanOrientationChange(<value>. This command is used in shouldAutorotateToInterfaceOrientation, which is supposed to determine if it is okay to let the display rotate with rotation of the device.

Since the command does not appear in Tier1, I figured I'd do a simple Tier2 app to show the what gets returned when I try to force the orientation. So I copied the xcode4 template (v1075 build) into the Projects/Native directory and renamed it, opened it, did the things to change code signing and names and tried to build. It couldn't find anything because it looked for it all to be relative to the build directory, but assumed it was in the IDE/apps path. So, I started over and put my new project in the IDE/apps path, then it compiled. But when I tried to run it, it had brain failure. This is the set of errors:


So I first looked at UntitledViewController.m, where the first error was indicated, and saw that the code had not been updated as it had in the interpreter_ios file set.

So, being the geek that I am, I checked for other differences. The only difference (other than commented lines and white space) was:



I changed applied only the changes in shouldAutorotateToInterfaceOrientation, cleaned, built and ran:


When I applied both sets of changes, a whole slew of errors popped up. So, for the non-interpreter apps, "self.view" is correct.

The error is occurring when agk:latformSetDevice is called when the agk::InitGL call is being made, based on the call stack sequence shown in Xcode.

I ran into the same error when I tried to run the "Box2D - Box2D" project from the Projects/Native/iOS/projects directory.

I am going to try v1074 and see if I get the same problems.

Cheers,
Ancient Lady
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 6th Jun 2012 19:02
Okay, I tested v1074 and had no problem compiling and running the iOS Xcode4 templates.

So, it is a problem with the v1075 template. I will now post it in google list.

Cheers,
Ancient Lady
bjadams
AGK Backer
14
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 15th Jun 2012 14:53
i got a new macbook with Lion and installed the latest xcode 4 & sdk5.1. previously I was using exclusively xcode3.

everything compiles fine, but my app crashes on launch in the initGL part. this happens both in simulator and on the actual device. i am using the xcode4 template in the template directory.

do i need to set anything in particular?
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 15th Jun 2012 17:29
I still haven't solved the problem with the template and the issue in the google list (#344) has been accepted as a defect at the medium level.

I'm not sure how to solve the problem.

I might try grabbing a v1074 template out and see if it compiles and runs with the v1076 setup. I'll try to do it today. But I might not get to it until Monday (off to celebrate another nephew graduating high school).

Cheers,
Ancient Lady
Hodgey
12
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 21st Jun 2012 15:14
I was able to get the xcode 4 ios_template running today. I downloaded the latest xcode 4 (4.3.3 came out 10 days ago) and I altered the UntitledViewController.m file to have this:

agk::InitGL( self );

After linking the libraries and headers as well, it ran for me on the iOS simulator (5.1).

If I can master the process, I'll make a video.

Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 21st Jun 2012 18:49
Brilliant! At least now it runs.

I also replaced the shouldAutorotateToInterfaceOrientation with the one from the interpreter_ios/Classes/UntitledViewController.m and added didRotateFromInterfaceOrientation from the same file.

Here is the set of messages created in the 'All Output' display when run on the iPhone simulator:


I suspect it is all ignorable, because this is what I got when run on my iPod:


It looks like the only difference of any significance in UntitledViewController.m between the Tier 1 and Tier 2 versions is including template.h instead of interpreter.h in the Tier 2 version.

Cheers,
Ancient Lady
bjadams
AGK Backer
14
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 22nd Jun 2012 00:06
Hodgey, even a simple step by step list would do!
Hodgey
12
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 22nd Jun 2012 10:08
bjadams
AGK Backer
14
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 23rd Jun 2012 00:25
bjadams
AGK Backer
14
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 23rd Jun 2012 00:26
the InitGL was what was causing problems here

Login to post a reply

Server time is: 2022-10-04 13:30:29
Your offset time is: 2022-10-04 13:30:29