我正在尝试通过将其拆分到不同的子项目中来调制我的应用程序。受this idea启发。因此,我将项目拆分为静态库,后跟that tutorial。我创建了第一个带有服装UIHelpers/Views
的库。它具有一些依存关系,这些依存关系我在PodSpec
文件中定义,然后在AFNetworking example中定义。 (依赖项之一是Choosy)。我将此库存储在bitBucket中。该库一切正常(我可以在Xcode中构建它)。当我创建一个Model
库时,问题开始了。我在UIHelpers
中指定Model PodFile
的Git路径。每当No visible @interface
中的类别出现错误Choosy
时(错误来自我项目中的CocoaPod NOT,该类别就会导入.m
文件中)。我尝试将link flags
和-ObjC,$(inhereted),-force_load
都包括在内。Objective-C categories in static library我清理了派生数据。我读了CocoaPodTroubleShoutes。
有人可以建议可以尝试的方法。关于该编译错误,存在很多问题,但是没有一个对我有帮助。我相信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
窗格中复制了这些文件并手动将其包括在内。我们仍然在其他地方使用Choosy
。不幸的是,错误还不够清楚,无法推断出错误所在。