Cocoapods 中没有可见的@interface
No visible @interface in Cocoapods
我正在尝试通过将我的应用拆分为不同的子项目来对其进行模块化。
受到 this idea. So I splited my project to static libraries followed by that tutorial. I created a first library with some costume UIHelpers/Views
. It has some dependencies which I defined in PodSpec
file followed by AFNetworking example. (one of the dependencies is Choosy). I stored this library in bitBucket. Everything is working fine for that library(I can build it in Xcode). The problem start when I create a Model
Library. I specify Git path of UIHelpers
in the Model PodFile
. Every time I get an error of No visible @interface
for a category in Choosy
(the error come from CocoaPod NOT in my project, the category is imported in the .m
file). I tried to play with link flags
-ObjC,$(inhereted),-force_load
included all of them.Objective-C categories in static library 的启发,我清理了派生数据。
我读了 CocoaPodTroubleShoutes.
有人可以建议可以尝试什么。关于那个编译错误有很多问题,但 none 帮助了我。
我相信问题出在我的 PodSpec
(不能确定)pod lib linit
我收到:
- ERROR | [iOS] Choosy/Choosy/Model/ChoosyAppInfo.m:32:19: error: no visible @interface for 'UIImage' declares the selector 'applyMaskImage:completion:'
我的 PodSec:
Pod::Spec.new do |s|
#I tried this options:
#s.xcconfig = { 'OTHER_LDFLAGS' => $(inherited) }
#s.compiler_flags = '-ObjC'
#'-all_load'
#$(inherited)
#'-DOS_OBJECT_USE_OBJC=0', '-Wno-format'
#'-force_load'
s.prefix_header_contents = '#import <UIKit/UIKit.h>', '#import <Foundation/Foundation.h>','#import <CoreGraphics/CoreGraphics.h>','#import "ARNStyles.h"'
s.description = <<-DESC
A longer description of ARNUIHelpers in Markdown format.
DESC
s.homepage = "http://EXAMPLE/ARNUIHelpers"
s.platform = :ios, "7.0"
s.ios.deployment_target = "7.0"
s.source_files = 'UIHelpers/**/*.{h,m}'
s.requires_arc = true
s.subspec 'Choosy' do |ss|
ss.requires_arc = true
ss.compiler_flags = '-force_load'
ss.platform = :ios, "7.0"
ss.dependency 'Choosy'
# ss.xcconfig = { "FRAMEWORK_SEARCH_PATHS" => "$(PODS_ROOT)/Headers/Public/Choosy"}
# ss.ios.public_header_files = 'UIImage+ImageEffects.h'
end
s.subspec 'Dependencies' do |ss|
#ss.ios.public_header_files = 'UIImage+ImageEffects.h'
ss.requires_arc = true
ss.dependency 'FormatterKit'
end
end
最后都是我的错。以前的开发人员从 Choosy
pod 复制了这些文件并包含它 manually.We 在其他地方仍然使用 Choosy
。不幸的是,错误不够清楚,无法推断出问题所在。
我正在尝试通过将我的应用拆分为不同的子项目来对其进行模块化。
受到 this idea. So I splited my project to static libraries followed by that tutorial. I created a first library with some costume UIHelpers/Views
. It has some dependencies which I defined in PodSpec
file followed by AFNetworking example. (one of the dependencies is Choosy). I stored this library in bitBucket. Everything is working fine for that library(I can build it in Xcode). The problem start when I create a Model
Library. I specify Git path of UIHelpers
in the Model PodFile
. Every time I get an error of No visible @interface
for a category in Choosy
(the error come from CocoaPod NOT in my project, the category is imported in the .m
file). I tried to play with link flags
-ObjC,$(inhereted),-force_load
included all of them.Objective-C categories in static library 的启发,我清理了派生数据。
我读了 CocoaPodTroubleShoutes.
有人可以建议可以尝试什么。关于那个编译错误有很多问题,但 none 帮助了我。
我相信问题出在我的 PodSpec
(不能确定)pod lib linit
我收到:- ERROR | [iOS] Choosy/Choosy/Model/ChoosyAppInfo.m:32:19: error: no visible @interface for 'UIImage' declares the selector 'applyMaskImage:completion:'
我的 PodSec:
Pod::Spec.new do |s|
#I tried this options:
#s.xcconfig = { 'OTHER_LDFLAGS' => $(inherited) }
#s.compiler_flags = '-ObjC'
#'-all_load'
#$(inherited)
#'-DOS_OBJECT_USE_OBJC=0', '-Wno-format'
#'-force_load'
s.prefix_header_contents = '#import <UIKit/UIKit.h>', '#import <Foundation/Foundation.h>','#import <CoreGraphics/CoreGraphics.h>','#import "ARNStyles.h"'
s.description = <<-DESC
A longer description of ARNUIHelpers in Markdown format.
DESC
s.homepage = "http://EXAMPLE/ARNUIHelpers"
s.platform = :ios, "7.0"
s.ios.deployment_target = "7.0"
s.source_files = 'UIHelpers/**/*.{h,m}'
s.requires_arc = true
s.subspec 'Choosy' do |ss|
ss.requires_arc = true
ss.compiler_flags = '-force_load'
ss.platform = :ios, "7.0"
ss.dependency 'Choosy'
# ss.xcconfig = { "FRAMEWORK_SEARCH_PATHS" => "$(PODS_ROOT)/Headers/Public/Choosy"}
# ss.ios.public_header_files = 'UIImage+ImageEffects.h'
end
s.subspec 'Dependencies' do |ss|
#ss.ios.public_header_files = 'UIImage+ImageEffects.h'
ss.requires_arc = true
ss.dependency 'FormatterKit'
end
end
最后都是我的错。以前的开发人员从 Choosy
pod 复制了这些文件并包含它 manually.We 在其他地方仍然使用 Choosy
。不幸的是,错误不够清楚,无法推断出问题所在。