ios - 将 SensibleTableView (STV) 的静态库与 cocoapods 一起使用

标签 ios xcode static-libraries cocoapods

我想使用 STV标准框架是一个静态库,闭源。我对 podspec 进行了试验,但到目前为止,我还没有让它工作。 header 找到了,但 .m 似乎丢失了。

这是框架的文件夹结构:!

enter image description here

我在“静态框架”文件夹中有 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/

相关文章:

iphone - 放大/缩小时 MKAnnotationView 错误更改了图钉图像

xcode - 在构建qt项目时“no such sysroot directory”

ios - IOS静态库如何运行presentViewController

c++ - "Illegal block entry"以及 yaml-cpp 中的 YAML 怪物示例

c++ 带有静态库的 undefined reference

ios - 如何使用swift更新tableview中的数据?

ios - swift中的延迟函数

ios - LLDB 中是否有 Quicklook 调试命令?

ios - 使用私有(private) API 强制 iOS 应用程序在前台打开

swift - 是否可以在 Xcode 中运行单个 Swift 文件 main()?