【问题标题】:Add Parse.com 1.11.0 to watchOS 2将 Parse.com 1.11.0 添加到 watchOS 2
【发布时间】:2016-03-20 14:25:57
【问题描述】:

在 Parse SDK 更新到 1.11.0 时,它说它支持 watchOS 和 tvOS。我想知道如何使用 Cocoapods 将框架添加到我的 watchOS 应用程序中。 pod 文件包含 pod 'Parse' 并且我已经运行 pod update 然后 pod install 但是当我向 watchOS 2 Extension 添加桥接头时,它说找不到文件。

你知道我应该做什么吗?

谢谢

【问题讨论】:

    标签: ios parse-platform swift2 watchos-2


    【解决方案1】:

    似乎QuickStart 说明尚未针对 watchOS 2 进行更新。我在announcement either 中找不到任何信息。

    如果您只需要在 WatchKit 扩展目标上使用 Parse,那么一个简单的 Podfile similar to this 就可以工作:

    # Uncomment this line to define a global platform for your project
    # platform :ios, '8.0'
    # Uncomment this line if you're using Swift
    # use_frameworks!
    
    target 'MyApp' do
    
    end
    
    target 'MyApp WatchKit App' do
    
    end
    
    target 'MyApp WatchKit Extension' do
        platform :watchos, '2.0'
        pod 'Parse', '~> 1.11'
    end
    

    但是,如果您需要在 iOS 目标和 WatchKit 扩展目标中使用 Parse(例如,在 iOS 上注册 Push Notifications 并在 WatchKit 上与 Parse 通信),事情就有点复杂了。

    由于"Generated duplicate UUIDs" bug in CocoaPods,您将需要to work around the issue,首先在您的终端中运行:

    export COCOAPODS_DISABLE_DETERMINISTIC_UUIDS=YES
    

    接下来,你可以像这样创建一个 Podfile:

    # Uncomment this line to define a global platform for your project
    # platform :ios, '8.0'
    # Uncomment this line if you're using Swift
    # use_frameworks!
    
    target 'MyApp' do
        platform :ios, '8.0'
        pod 'Parse', '~> 1.11'
    end
    
    target 'MyApp WatchKit App' do
    
    end
    
    target 'MyApp WatchKit Extension' do
        platform :watchos, '2.0'
        pod 'Parse', '~> 1.11'
    end
    

    最后,pod install,你应该很高兴!

    【讨论】:

      猜你喜欢
      • 2015-09-06
      • 1970-01-01
      • 1970-01-01
      • 2023-03-31
      • 1970-01-01
      • 2016-11-25
      • 1970-01-01
      • 2013-09-29
      • 1970-01-01
      相关资源
      最近更新 更多