Xcode没有看到通过可可豆荚安装的框架

时间:2017-02-06 10:41:37

标签: swift xcode

我正在尝试将SharkORM框架添加到我的应用程序中,但不知何故在安装pod之后看起来像:

target 'XXX' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for XXX

pod 'Firebase/Core'
pod 'SharkORM'

  target 'XXXTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'XXXUITests' do
    inherit! :search_paths
    # Pods for testing
  end

end

并使用命令pod install;得到这个:

Analyzing dependencies
Downloading dependencies
Using Firebase (3.12.0)
Using FirebaseAnalytics (3.6.0)
Using FirebaseCore (3.4.7)
Using FirebaseInstanceID (1.0.8)
Using GoogleInterchangeUtilities (1.2.2)
Using GoogleSymbolUtilities (1.1.2)
Using GoogleToolboxForMac (2.1.1)
Using SharkORM (2.1.1)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 2 dependencies from the Podfile and 8 total pods installed.

这听起来很棒,因为安装成功了。

AppDelegate.swift获取错误:

在此处使用未声明的类型'SRKDelegate'

class AppDelegate: UIResponder, UIApplicationDelegate, SRKDelegate {

我会说我必须在我的文件顶部使用import SharkORM,但它不会显示我存在此文件。它应该 - >在Pods文件中我有这些组件然后发生了什么?你可以看到我正在使用正在运行的Firebase

提前致谢!

2 个答案:

答案 0 :(得分:1)

  1. 安装框架

    pod install
    
  2. 打开工作区XXX.xcodeproj并创建桥接标头。创建桥接标题

    //File -> New File -> Header File
    //Save it as a YourApp-Bridging-Header
    
  3. 编译SharkORM框架目标

  4. enter image description here

    1. 然后在您的应用中添加框架标题,方法是将其添加到桥接标题

      #include <SharkORM/SharkORM.h>
      
    2. 导入模块导入AppDelegate类中的SharkORM

      import SharkORM››
      
    3. 在AppDelegate类中添加SRKDelegate

      class AppDelegate: UIResponder, UIApplicationDelegate, SRKDelegate
      

答案 1 :(得分:0)

您必须import SharkORM才能使用该广告连播。另外,请确保您在与项目相同的目录中处理.xcworkspace文件(当您执行pod install时自动创建它。