【问题标题】:No visible @interface in CocoapodsCocoapods 中没有可见的@interface
【发布时间】:2015-05-17 12:44:50
【问题描述】:

我正在尝试通过将我的应用拆分为不同的子项目来对其进行模块化。 灵感来自this idea。所以我将我的项目拆分为静态库,然后是that tutorial。我用一些服装创建了第一个库UIHelpers/Views。它有一些我在PodSpec 文件中定义的依赖项,然后是AFNetworking example。 (其中一个依赖项是Choosy)。我将此库存储在 bitBucket 中。该库一切正常(我可以在 Xcode 中构建它)。当我创建一个Model 库时,问题就开始了。我在Model PodFile 中指定了UIHelpers 的Git 路径。每次我在Choosy 中的某个类别出现No visible @interface 错误(错误来自我的项目中的CocoaPod 不是,该类别被导入.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】:

    最后都是我的错。之前的开发者从Choosy pod 中复制了这些文件并手动包含它。我们在其他地方仍然使用Choosy。不幸的是,错误不够清楚,无法推断出什么是错误的。

    【讨论】:

      猜你喜欢
      • 2016-08-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-07
      • 1970-01-01
      • 2017-10-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多