# XCode 7 & PowerVR SDK Examples (I know, it's early)....

**URL:** <https://forums.imgtec.com/t/xcode-7-powervr-sdk-examples-i-know-its-early/2363>\
**Category:** PowerVR Insider\
**Created:** [September 11, 2015, 10:34pm UTC](https://forums.imgtec.com/t/xcode-7-powervr-sdk-examples-i-know-its-early/2363 "2015-09-11T22:34:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jvene](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@jvene](https://forums.imgtec.com/u/jvene)\
**Post date:** [September 11, 2015, 10:34pm UTC](https://forums.imgtec.com/t/xcode-7-powervr-sdk-examples-i-know-its-early/2363/1 "2015-09-11T22:34:30Z")

</div>

PowerVR SDK 3.5 using XCode 7, targeting iOS 6.1 (and others).

The sample(s) build, but on execution the following happens:

InitApplication() succeeded  
InitView() succeeded  
2015-09-11 18:59:27.340 OGLES2Water[1863:58149] \*\*\* Assertion failure in -[UIApplication \_runWithMainScene:transitionContext:completion:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit\_Sim/UIKit-3505.16/UIApplication.m:3294  
2015-09-11 18:59:27.351 OGLES2Water[1863:58149] \*\*\* Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘Application windows are expected to have a root view controller at the end of application launch’

That explains it well enough, the code in AppController.mm has:

```
[_window addSubview:_glView];

```

Other threads on this related error state that a call to setRootViewController is required, but I’m not sure what complies. \_glView doesn’t appear to be acceptable (doesn’t compile if I change the line to

[\_window setRootViewController:\_glView];

The compiler says EAGLView can’t be the lvalue,

It SEEMS this just requires a simple adjustment - thought someone here might know what qualifies as the UIViewController object in the typical examples provided in PowerVR SDK 3.5 (like Water)

---

<div class="post-metadata">

**Author:** ![jvene](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@jvene](https://forums.imgtec.com/u/jvene)\
**Post date:** [September 12, 2015, 3:07pm UTC](https://forums.imgtec.com/t/xcode-7-powervr-sdk-examples-i-know-its-early/2363/2 "2015-09-12T15:07:36Z")

</div>

Update, of a kind:

It seems this may be an iOS 9 issue, not an Xcode 7 issue. Similar inquiry, but at least if we target and build for an iOS 8.x device, the software works. An iOS 9 simulator will crash, even if the build targets older (say, 6.1) versions.

---

<div class="post-metadata">

**Author:** ![jvene](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@jvene](https://forums.imgtec.com/u/jvene)\
**Post date:** [September 13, 2015, 2:53am UTC](https://forums.imgtec.com/t/xcode-7-powervr-sdk-examples-i-know-its-early/2363/3 "2015-09-13T02:53:03Z")

</div>

At the risk of talking to myself ( 😉 ) I found AN answer, not sure if it’s really the RIGHT answer, but here’s what worked:

In AppController.h of the sample, the following objective-C interface is declared

@interface AppController : NSObject \<UIAccelerometerDelegate\>

So, I changed that to:

@interface AppController : UIViewController\<UIAccelerometerDelegate\>

Then, in AppController.mm, at comment “Create a full-screen window”, where it allocates the \_window member, I added:

\_window.rootViewController = self;

Now, it launches without complaint or incident.

The reason I think it’s not the RIGHT answer is that it is incomplete. Now, when rotating a device, the display orients in inappropriate ways, probably because it’s not controlled so as to ignore the orientation.

At least it’s a good start.

---

<div class="post-metadata">

**Author:** ![JoeDavis](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/joedavis/32/71_2.png) [@JoeDavis](https://forums.imgtec.com/u/JoeDavis)\
**Post date:** [September 14, 2015, 2:35pm UTC](https://forums.imgtec.com/t/xcode-7-powervr-sdk-examples-i-know-its-early/2363/4 "2015-09-14T14:35:40Z")

</div>

Thanks for reporting the issue. I’ll discuss it with the SDK team

---

<div class="post-metadata">

**Author:** ![JoeDavis](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/joedavis/32/71_2.png) [@JoeDavis](https://forums.imgtec.com/u/JoeDavis)\
**Post date:** [September 21, 2015, 7:13am UTC](https://forums.imgtec.com/t/xcode-7-powervr-sdk-examples-i-know-its-early/2363/5 "2015-09-21T07:13:48Z")

</div>

Apologies for the delayed response. We’ve reproduced the issue. I’ve filed a P1 bug against the SDK (BRN57583) to make sure this is fixed in our upcoming 4.0 SDK release.
