我最近才开始使用Xcode 8 beta 4,但到目前为止它一直很好用.我的任何项目都没有显示模拟器列表.我已经尝试过创建一个新的Scheme,但它没有用.我该如何解决?
所以我最近刚刚更新到Xcode 8,我刚刚得到以下代码的错误.
错误是该方法不会覆盖它的超类中的任何方法.
override func preferredStatusBarStyle() -> UIStatusBarStyle {
return UIStatusBarStyle.lightContent
}
Run Code Online (Sandbox Code Playgroud)
我非常感谢帮助,谢谢!
这个Swift 3代码一直工作到XCode 8 beta 3:
let calendar = Calendar.current
let anchorComponents = calendar.components([Calendar.Unit.day, Calendar.Unit.month, Calendar.Unit.year, Calendar.Unit.hour], from: self)
Run Code Online (Sandbox Code Playgroud)
在Xcode 8中,beta 4 Calendar.Unit
似乎被重命名为Calendar.Component
.
现在这段代码
let calendar = Calendar.current
let anchorComponents = calendar.components([Calendar.Component.day, Calendar.Component.month, Calendar.Component.year, Calendar.Component.hour], from: self)
Run Code Online (Sandbox Code Playgroud)
产生编译错误 cannot convert value of type Calendar.Component to NSCalendar.Unit
我做错了什么或这是一个错误?
似乎在将旧代码转换为beta 4时,我继续将错误转换为NSError.这有时甚至会导致警告"从'错误'到'NSError'的条件转换总是成功".我觉得我不明白如何最好地使用Error.我想像error.code,error.localizedDescription那样思考......有没有很好的文档或教程来解释这些错误的变化?
例如:
func webView(_ webView: UIWebView, didFailLoadWithError error: Error) {
Run Code Online (Sandbox Code Playgroud)
现在我做的事情如下:
if let error = error as? NSError {
if error.code == NSURLErrorCancelled {
Run Code Online (Sandbox Code Playgroud)
但是这给出了警告"从'错误'到'NSError'的条件转换总是成功的"
在iOS 10和xcode 8中,当我尝试登录谷歌服务时,我收到"钥匙串错误"
func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error!){
if error != nil {
print("\(error!.localizedDescription)")
}
}
Run Code Online (Sandbox Code Playgroud)
在SO上提供和接受的解决方案是直接从模拟器而不是通过Xcode运行应用程序.我试过这个并没有成功因此在这里发布这个问题,希望有人有更新的解决方案或经验.
我无法使用xcode为iOS 10 beta 4上的应用程序下载app容器.我正在使用后来的xcode(beta 4).当我连接我的设备并进入Device
xcode时,我能够看到我的应用程序列出,但当我点击下载容器时,我得到以下错误:
是否与我的应用设置或设备设置有关.如何获取iOS10 beta 4的应用数据.
我正在创建一个iOS/macOS应用程序,它通过Multipeer Connectivity Framework使用远程控制功能.由于要远程监视和控制的设备将在较长时间内运行,因此使用自动视图控制器方法是不可行的,因为监视设备可能被锁定或进入休眠状态,然后断开连接.所以我使用的是编程方法,这样当监控设备失去连接时,他们会在解锁/唤醒并且应用程序再次启动时自动配对.我的连接使用ViewController方法工作正常,但不是编程委托方法.广告,浏览和邀请工作正常,但是当远程端接受邀请时,我会收到几个错误,然后连接失败.奇怪的是,有几个错误是GCKSession错误.
那么为什么要尝试使用GameCenter框架呢?为什么在接受邀请后失败?它可能只是Xcode 8/Swift 3/iOS 10/macOS Sierra Beta SDK中的一个错误吗?
[ViceroyTrace] [ICE][ERROR] ICEStopConnectivityCheck() found no ICE check with call id (2008493930)
[GCKSession] Wrong connection data. Participant ID from remote connection data = 6FBBAE66, local participant ID = 3A4C626C
[MCSession] GCKSessionEstablishConnection failed (FFFFFFFF801A0020)
Peer Changing
Failed
[GCKSession] Not in connected state, so giving up for participant [77B72F6A] on channel [0]
Run Code Online (Sandbox Code Playgroud)
这是我的连接类的代码
func startAdvertisingWithoutUI () {
if advertiserService == nil {
advertiserService = MCNearbyServiceAdvertiser (peer: LMConnectivity.peerID, discoveryInfo: nil, serviceType: "mlm-timers")
advertiserService?.delegate = …
Run Code Online (Sandbox Code Playgroud) multipeer-connectivity swift3 ios10 macos-sierra xcode8-beta4
Xcode 8 beta 4不再识别基础课程AttributedString
.
我在这个简单的游乐场示例中重现了它:
//: Playground - noun: a place where people can play
import Foundation
let attrStr1 = NSAttributedString()
let attrStr2 = AttributedString() // Use of undeclared type 'AttributedString'
Run Code Online (Sandbox Code Playgroud)
由于AttributedString
在较旧的Xcode 8 Swift 3测试版中可用,我想这是一个Foundation
需要修复的bug,而不是Playground中的一些源代码错误?
我做了一个消息扩展,当我在iOS模拟器上运行时,一切都没有问题.当我尝试在手机上运行它时,它会编译并说在崩溃之前运行大约5秒并在Xcode中给我一个弹出消息说Could not attach to pid
这是一个截图:
我在iOS 10中使用Xcode 8 beta 4.一切都在模拟器中运行良好,这是在物理设备上.我重新启动并重新启动了一切.我甚至试过两部手机.谁知道解决方案?
谢谢
xcode8-beta4 ×10
swift3 ×5
ios10 ×4
xcode ×4
xcode8 ×4
swift ×2
appcontainer ×1
gidsignin ×1
ios ×1
keychain ×1
macos-sierra ×1