【发布时间】:2016-10-14 18:56:42
【问题描述】:
我遇到了与帖子YouTube-Player-iOS-Helper can't use YTPlayerView class 中相同的问题。 但是,在我按照同一帖子https://stackoverflow.com/a/30719229 中的答案在桥接头文件中导入“YTPlayerView.h”后,Xcode 说找不到“YTPlayerView.h”文件。
我用来安装“YouTube-Player-iOS-Helper”的 Podfile:
project 'YTSwift.xcodeproj'
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target 'YTSwift' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for YTSwift
pod "youtube-ios-player-helper"
end
target 'YTSwiftTests' do
inherit! :search_paths
# Pods for testing
end
target 'YTSwiftUITests' do
inherit! :search_paths
# Pods for testing
end
我的“Bridging-Header.h”:
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//
#import "YTPlayerView.h"
请告知如何解决此问题,谢谢! 如果有任何必要的文件内容供您参考,请告诉我。 谢谢!
【问题讨论】:
-
先尝试使用 pod 构建,然后尝试导入。
-
@Dershowitz123 感谢您的回复。 “使用 pod 构建”是否意味着像 link 这样的切换方案然后构建?
-
不,不要切换任何方案。安装 pod 并打开 .xcworkspace 后,只需按 command+B。然后尝试。有时 pod 不会链接到您的项目。构建项目会将其中的所有内容链接到。
-
@Dershowitz123 好的。我会清理并删除派生数据,稍后再尝试构建。
-
@Dershowitz123 我在头文件中注释了"#import "YTPlayerView"这一行并进行了清理和删除,在不更改方案的情况下构建成功。但是,当我添加时问题仍然存在返回头文件中的“#import“YTPlayerView”行并再次构建。我的步骤正确吗?
标签: ios objective-c swift youtube