2016-07-19 24 views
0

我想在我的应用程序中应用OneDrive SDK。如何获得ios OneDrive框架

https://github.com/onedrive/onedrive-sdk-ios

这个网站只有一个使用cocoapod方式。但我想申请.framework文件(不使用cocoapod)。

如何获取OneDrive.framework文件。

@Dylan S

谢谢你的描述,但我有错误。

这是我的过程。

  1. 下载OneDrive源 enter image description here

  2. 在OneDriveSDK文件夹:荚安装 enter image description here

  3. ,并导致

enter image description here

  • 打开OneDriveSDK.xcworkspace文件并生成
  • enter image description here

  • 得到OneDriveSDK.framework enter image description here

  • 在我的项目和buld中添加这个框架。 但我有链接错误。

  • 我的测试代码:

    #import <OneDriveSDK/OneDriveSDK.h> 
    [ODClient clientWithCompletion:^(ODClient *client, NSError *error){ 
        if (!error){ 
    //   self.odClient = client; 
        } 
    }]; 
    

    连接错误:

    enter image description here

    是不是我的过程吗?

    +1

    您可以下载源代码,配置Xcode方案,并将其构建到框架中。 – dylansturg

    +0

    @DylanS请让我详细了解。这是什么意思? ''配置一个Xcode方案' – dh0rmfpdlxm

    回答

    0

    您可以构建自己的框架副本,无需将其安装为Cocoapod,但在构建时仍需要使用Cocoapods。 OneDriveSDK使用Cocoapods。

    无论如何,首先下载代码(在主人或任何你想要的版本)。它在GitHub上,所以在那里流行。我会等。

    接下来,安装它的Cocoapod依赖关系,以便Xcode能够构建代码。如果你没有安装Cocoapods,你需要安装与sudo gem install cocoapods宝石。结账their guide欲了解更多信息。

    您可以在OndeDriveSDK目录内安装包含pod install的项目,该目录位于文件名为Podfile的文件夹中。

    现在您已准备好构建:打开“OneDriveSDK.xcworkspace”(注意xcworkspace而不是xcodeproj)。

    Xcode scheme setup

    选择了 “OneDriveSDK” 计划和建立 “通用iOS设备”。参考上面的截图。

    最后,建立它。产品 - > Build For - >运行。它应该工作,它为我做。

    一旦Xcode完成,打开“产品”文件夹。找到“OneDriveSDK.framework”并右键单击选中的“查找器中显示”。下面有一个屏幕截图,看看要找什么。抓住框架文件,你准备好了。把它放到你的项目中。

    enter image description here

    0

    UPDATE: 示例代码:https://github.com/soheilbm/StackOverFlowQ1


    1. 安装cococapod和Rome plugin

      gem install cocoapods 
      gem install cocoapods-rome 
      
    2. 创建一个空的项目(测试),并设置podfile有:

      platform :ios, '8.0' 
      use_frameworks! 
      
      target 'Testing' do 
          plugin 'cocoapods-rome' 
          pod 'OneDriveSDK' 
      end 
      
    3. 运行:

      pod install 
      
    4. 去罗马目录,并将所有框架(除Pods_Testing.framework

    enter image description here

    +0

    我做到了,非常感谢 – dh0rmfpdlxm

    +0

    很高兴我能帮忙:) –