简体   繁体   中英

Using a static library of SensibleTableView (STV) with cocoapods

I want to use STV Standard framework which is a static libraray, closed source. I experimented with the podspec, but up to now, I didn't get it to work. The header arefound, but the .m seem to be missing.

Here is the folder structure of the framework:!

在此处输入图片说明

I have the podspec in the "Static Frameworks" folder.

This is the podspec file:

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

end

And I call the podspec in the podfile with this line:

 pod 'SensibleTableView', :path => "/Users/myPath/Static Frameworks/"

There are no error messages while installing the pod, but when building the project, I get these errors:

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)

I've already tried out a lots of stuff, but appearently there is a part missing in the podspec? Any help appreciated.

EDIT: I import the podfile this way #import <SensibleTableView/SensibleTableView.h>

Not sure how you're including the framework since that doesn't seem to be part of the snippet above. You probably want the vendored_frameworks attribute.


EDIT from the one who was asking - this is the resulting 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM