RealmSwift-1.2 和 iOS-9,带有基于 iOS 的 WatchKit-Extension(全部在 iPhone 上)
RealmSwift-1.2 and iOS-9 with iOS-based WatchKit-Extension (all on iPhone)
使用 iOS-9.01 / Swift-1.2 / 领域Swift-1.2 / XCode-7.0.1:
我尝试将我的工作 AppleWatch-1.0 应用程序更新到 iOS9,仍在使用 Swift-1.2,并且仍然希望在 运行 上安装 AppleWatch-App 运行 =70=](AppleWatch 本身不支持)。
在 XCode7 中首次打开时,遗憾的是应用程序不再编译!我最终遇到以下错误:
在 XCode7 中首次启动后的错误消息 (1)(应用程序在 XCode6.4 下运行良好):
Target 'Pods-MyApp WatchKit Extension' of project 'Pods' was rejected as an
implicit dependency for 'Pods_MyApp_WatchKit_Extension.framework' because it
doesn't contain platform 'watchsimulator' in its SUPPORTED_PLATFORMS 'iphonesimulator,
iphoneos'
这个错误是什么意思???
我读到 in another post,需要对 WatchKit-Extension 的架构设置(即调试目标)进行不同的设置
Base-SDK(在 Build Settings/Architecture 下)设置需要什么???
首次启动后,Base-SDK 默认设置为 watchOS(如下图第一张所示)。但是因为我想让应用程序纯粹是 iPhone-应用程序,所以我认为这个 Base-SDK 应该设置为 "Latest iOS (iOS 9.0)"。这是正确的吗??
将 Base-SDK 设置为 "Latest iOS (iOS 9.0)" 后,"General" 选项卡消失(见下图)。所以我认为这也不正确??或者是?
不仅 "General" 选项卡消失了,而且还出现了另一个错误:
将Base-SDK更改为Latest-iOS后的错误信息(2)(iOS 9.0):
target specifies product type 'com.apple.product-type.watchkit2-extension',
but there's no such product type for the 'iphonesimulator' platform
如果为 Debug 和 Release 设置不同的 "Supported Platform" (according to the suggestion of the other post),我将返回到 Error-message1
有关支持平台设置的组合,请参见下图:
错误消息 (1) 现已返回....
Target 'Pods-MyApp WatchKit Extension' of project 'Pods' was rejected as an
implicit dependency for 'Pods_MyApp_WatchKit_Extension.framework' because it
doesn't contain platform 'watchsimulator' in its SUPPORTED_PLATFORMS 'iphonesimulator,
iphoneos'
问题仍然存在:为了使应用程序按预期工作,还需要做些什么??
感谢您对此提供任何帮助!
此外,我的 Cocoa Podfile 如下所示:
xcodeproj 'MyApp.xcodeproj'
workspace 'MyApp.xcworkspace'
platform :ios, '9.0'
inhibit_all_warnings!
source 'https://github.com/artsy/Specs.git'
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
link_with 'MyApp', 'MyApp WatchKit Extension'
def shared_pods
pod 'Realm', :git => 'https://github.com/realm/realm-cocoa.git', :branch => 'swift-1.2'
pod 'RealmSwift', :git => 'https://github.com/realm/realm-cocoa.git', :branch => 'swift-1.2'
end
target 'MyApp' do
shared_pods
end
target 'MyAppTests' do
shared_pods
end
target 'MyApp WatchKit Extension' do
platform :ios, '9.0'
shared_pods
end
您正在使用 Swift 1.2 版的 Realms。 iOS 9 使用 Swift 2.0,所以我相信您只需要使用最新版本的 Realms:
def shared_pods
pod 'Realm'
pod 'RealmSwift'
end
使用 iOS-9.01 / Swift-1.2 / 领域Swift-1.2 / XCode-7.0.1:
我尝试将我的工作 AppleWatch-1.0 应用程序更新到 iOS9,仍在使用 Swift-1.2,并且仍然希望在 运行 上安装 AppleWatch-App 运行 =70=](AppleWatch 本身不支持)。
在 XCode7 中首次打开时,遗憾的是应用程序不再编译!我最终遇到以下错误:
在 XCode7 中首次启动后的错误消息 (1)(应用程序在 XCode6.4 下运行良好):
Target 'Pods-MyApp WatchKit Extension' of project 'Pods' was rejected as an
implicit dependency for 'Pods_MyApp_WatchKit_Extension.framework' because it
doesn't contain platform 'watchsimulator' in its SUPPORTED_PLATFORMS 'iphonesimulator,
iphoneos'
这个错误是什么意思???
我读到 in another post,需要对 WatchKit-Extension 的架构设置(即调试目标)进行不同的设置
Base-SDK(在 Build Settings/Architecture 下)设置需要什么???
首次启动后,Base-SDK 默认设置为 watchOS(如下图第一张所示)。但是因为我想让应用程序纯粹是 iPhone-应用程序,所以我认为这个 Base-SDK 应该设置为 "Latest iOS (iOS 9.0)"。这是正确的吗??
将 Base-SDK 设置为 "Latest iOS (iOS 9.0)" 后,"General" 选项卡消失(见下图)。所以我认为这也不正确??或者是?
不仅 "General" 选项卡消失了,而且还出现了另一个错误:
将Base-SDK更改为Latest-iOS后的错误信息(2)(iOS 9.0):
target specifies product type 'com.apple.product-type.watchkit2-extension',
but there's no such product type for the 'iphonesimulator' platform
如果为 Debug 和 Release 设置不同的 "Supported Platform" (according to the suggestion of the other post),我将返回到 Error-message1
有关支持平台设置的组合,请参见下图:
错误消息 (1) 现已返回....
Target 'Pods-MyApp WatchKit Extension' of project 'Pods' was rejected as an
implicit dependency for 'Pods_MyApp_WatchKit_Extension.framework' because it
doesn't contain platform 'watchsimulator' in its SUPPORTED_PLATFORMS 'iphonesimulator,
iphoneos'
问题仍然存在:为了使应用程序按预期工作,还需要做些什么?? 感谢您对此提供任何帮助!
此外,我的 Cocoa Podfile 如下所示:
xcodeproj 'MyApp.xcodeproj'
workspace 'MyApp.xcworkspace'
platform :ios, '9.0'
inhibit_all_warnings!
source 'https://github.com/artsy/Specs.git'
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
link_with 'MyApp', 'MyApp WatchKit Extension'
def shared_pods
pod 'Realm', :git => 'https://github.com/realm/realm-cocoa.git', :branch => 'swift-1.2'
pod 'RealmSwift', :git => 'https://github.com/realm/realm-cocoa.git', :branch => 'swift-1.2'
end
target 'MyApp' do
shared_pods
end
target 'MyAppTests' do
shared_pods
end
target 'MyApp WatchKit Extension' do
platform :ios, '9.0'
shared_pods
end
您正在使用 Swift 1.2 版的 Realms。 iOS 9 使用 Swift 2.0,所以我相信您只需要使用最新版本的 Realms:
def shared_pods
pod 'Realm'
pod 'RealmSwift'
end