Cocoapods中没有可见的@interface

问题描述 投票:2回答:1

我正在尝试通过将其拆分到不同的子项目中来调制我的应用程序。受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
ios xcode cocoapods static-linking podspec
1个回答
0
投票

最后是我的错。以前的开发人员从Choosy窗格中复制了这些文件并手动将其包括在内。我们仍然在其他地方使用Choosy。不幸的是,错误还不够清楚,无法推断出错误所在。

© www.soinside.com 2019 - 2024. All rights reserved.