在Xcode 7.2中生成错误的GPUImage示例

时间:2016-01-30 15:46:37

标签: ios xcode gpuimage

我对编程很新,我正在尝试通过示例来学习Brad Larson的 GPUImage

我正在使用 Xcode 7.2 ,很少有这些示例可以直接使用。

我发现如何通过更改部署目标来修复此错误"-fembed-bitcode is not supported on versions of iOS prior to 6.0"

但我无法想出这个:

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

我已经在stackOverflow上尝试了几个答案,但没有一个有效。为了缩小范围,我真的想看看colorObjectTracking示例是如何工作的。

1 个答案:

答案 0 :(得分:0)

问题是在方法rootViewController完成之前,主窗口的application:didFinishLaunchingWithOptions:属性未设置。

要解决此问题,您必须将此方法的主体(可在ColorTrackingAppDelegate.m文件中找到)更改为以下内容:

 - (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;
}

<强>更新 我提交了Pull Request,修复了ColorObjectTracking示例项目中导致问题的原因。你可以找到它here