我想使用 STV标准框架是一个静态库,闭源。我对 podspec 进行了试验,但到目前为止,我还没有让它工作。 header 找到了,但 .m 似乎丢失了。
这是框架的文件夹结构:!
我在“静态框架”文件夹中有 podspec。
这是 podspec 文件:
Pod::Spec.new do |s|
s.name = 'SensibleTableView'
s.version = '3.3.0'
s.platform = :ios
s.ios.deployment_target = '6.1'
framework_path = 'SensibleTableView.framework'
s.source_files = "#{framework_path}/Versions/A/Headers/*.h"
s.source = "#{framework_path}/Versions/A/SensibleTableView"
s.requires_arc = true
结束
然后我用这一行调用 podfile 中的 podspec:
pod 'SensibleTableView', :path => "/Users/myPath/Static Frameworks/"
安装 pod 时没有错误消息,但是在构建项目时,出现以下错误:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_SCArrayOfStringsSection", referenced from:
objc-class-ref in SettingsViewController.o
"_OBJC_CLASS_$_SCTableViewController", referenced from:
_OBJC_CLASS_$_SettingsViewController in SettingsViewController.o
"_OBJC_METACLASS_$_SCTableViewController", referenced from:
_OBJC_METACLASS_$_SettingsViewController in SettingsViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我已经尝试了很多东西,但 podspec 中似乎缺少了一部分?任何帮助表示赞赏。
编辑:
我以这种方式导入 podfile #import <SensibleTableView/SensibleTableView.h>
最佳答案
不确定您是如何包含框架的,因为它似乎不是上面代码片段的一部分。你可能想要 vendored_frameworks
属性。
从提问者那里编辑 - 这是生成的 podspec:
Pod::Spec.new do |s|
s.name = 'SensibleTableView'
s.version = '3.3.0'
s.platform = :ios
s.ios.deployment_target = '6.1'
s.vendored_frameworks = 'SensibleTableView.framework'
s.requires_arc = true
end
关于ios - 将 SensibleTableView (STV) 的静态库与 cocoapods 一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19542914/