【问题标题】:Using a static library of SensibleTableView (STV) with cocoapods使用带有 cocoapods 的 SensibleTableView (STV) 静态库
【发布时间】:2013-10-23 13:23:03
【问题描述】:

我想使用STV 标准框架,它是一个静态库,封闭源代码。我尝试了 podspec,但到目前为止,我还没有让它工作。标头已找到,但 .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>

【问题讨论】:

  • 不确定您是如何包含该框架的,因为它似乎不是上述 sn-p 的一部分。您可能需要vendored_frameworks 属性。
  • @KeithSmiley:宾果游戏,请把它放在一个答案中,我很乐意接受它。

标签: ios xcode static-libraries cocoapods


【解决方案1】:

不确定您是如何包含该框架的,因为它似乎不是上述 sn-p 的一部分。您可能需要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

【讨论】:

    猜你喜欢
    • 2015-07-18
    • 1970-01-01
    • 2013-06-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-26
    • 1970-01-01
    • 2013-09-11
    相关资源
    最近更新 更多