2013-10-23 21 views
1

我想使用STV標準框架,它是一個靜態庫,封閉源代碼。我嘗試了podspec,但到目前爲止,我沒有得到它的工作。標題已找到,但.m似乎已丟失。使用帶有cocoapods的SensibleTableView(STV)的靜態庫

這是框架的文件夾結構:!

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/" 

有在安裝吊艙沒有錯誤信息,但是在構建項目時,出現以下錯誤:

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>

+0

不知道你是如何包括框架,因爲這似乎並不爲上述片段的一部分。您可能需要['vendored_frameworks'](http://docs.cocoapods.org/specification.html#vendored_frameworks)屬性。 –

+0

@KeithSmiley:賓果,請給它一個答案,我會很樂意接受它。 – brainray

回答

2

不知道你是如何包括框架,因爲這似乎並不爲上述片段的一部分。您可能需要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