2016-07-19 75 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

    很高興我能幫忙:) –