Search code examples
iosxcodegpuimage

GPUImage examples producing errors in Xcode 7.2


I'm fairly new to programming and I'm trying to learn Brad Larson's GPUImage by going through the examples.

I'm using Xcode 7.2 and very few of the examples work out of the box.

I found out how to fix this error"-fembed-bitcode is not supported on versions of iOS prior to 6.0" just by changing the deployment target.

But I can't figure this one out:

'NSInternalInconsistencyException', reason: 'Application windows are expected to have a root view controller at the end of application launch'

I've tried several answers given on stackOverflow, but none of them have worked. To narrow it down, I really want to see how the colorObjectTracking example works.


Solution

  • The problem is that rootViewController property of the main window isn't set before method application:didFinishLaunchingWithOptions: finishes.

    To fix that you have to change the body of this method (it can be found in ColorTrackingAppDelegate.m file) to the one presented below:

     - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
     {
         self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
         self.window.backgroundColor = [UIColor whiteColor];
    
         self.window.rootViewController = [[ColorTrackingViewController alloc] initWithNibName:nil bundle:nil];
    
         [self.window makeKeyAndVisible];
         return YES;
    }
    

    Update: I submitted Pull Request which fixes issue in ColorObjectTracking example project that is the reason of your problems. You can find it here.