2015-12-14 55 views
4

在解析SDK更新到1.11.0它說它支持watchOS和tvOS。我想知道如何使用Cocoapods將框架添加到我的watchOS應用程序中。該pod文件包含pod 'Parse',並且我運行了pod update,然後pod install,但是當我將一個橋接頭添加到watchOS 2 Extension時,它說沒有找到文件。Add Parse.com 1.11.0 to watchOS 2

你知道我應該做什麼嗎?

謝謝

回答

2

這似乎是QuickStart指令尚未對watchOS 2.更新我找不到在announcement either的任何信息。

如果您只需要使用解析您WatchKit擴張對象,然後進行簡單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擴展目標(例如註冊iOS上的推送通知並與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 ,你應該很好走!