Xcode 7.2 中产生错误的 GPUImage 示例
GPUImage examples producing errors in Xcode 7.2
我是编程新手,我正在尝试通过示例学习 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'
我已经尝试了几个在 Whosebug 上给出的答案,但其中 none 有效。为了缩小范围,我真的很想看看 colorObjectTracking 示例是如何工作的。
问题是在方法 application:didFinishLaunchingWithOptions:
完成之前未设置主要 window 的 rootViewController
属性。
要解决此问题,您必须将此方法的主体(可在 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.
我是编程新手,我正在尝试通过示例学习 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'
我已经尝试了几个在 Whosebug 上给出的答案,但其中 none 有效。为了缩小范围,我真的很想看看 colorObjectTracking 示例是如何工作的。
问题是在方法 application:didFinishLaunchingWithOptions:
完成之前未设置主要 window 的 rootViewController
属性。
要解决此问题,您必须将此方法的主体(可在 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.