标签: xcode8-beta4

Xcode 8 Beta 4 - 评论快捷方式已禁用

我刚刚更新到Xcode 8 Beta 4和快捷方式cmd+ /来评论一行无法正常工作..

在下拉菜单中,它被禁用:

在此输入图像描述

有办法再次激活它吗?

xcode8 xcode8-beta4

116
推荐指数
4
解决办法
4万
查看次数

xcode8未显示的模拟器列表

我最近才开始使用Xcode 8 beta 4,但到目前为止它一直很好用.我的任何项目都没有显示模拟器列表.我已经尝试过创建一个新的Scheme,但它没有用.我该如何解决?

xcode ios ios-simulator xcode8 xcode8-beta4

52
推荐指数
7
解决办法
2万
查看次数

在Swift 3中删除了preferredStatusBarStyle?

所以我最近刚刚更新到Xcode 8,我刚刚得到以下代码的错误.

错误是该方法不会覆盖它的超类中的任何方法.

override func preferredStatusBarStyle() -> UIStatusBarStyle {
    return UIStatusBarStyle.lightContent
}
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

我非常感谢帮助,谢谢!

swift3 xcode8 xcode8-beta4

46
推荐指数
2
解决办法
2万
查看次数

Xcode 8 beta 4:Calendar.Unit与Calendar.Component

这个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

我做错了什么或这是一个错误?

swift3 xcode8 xcode8-beta4

26
推荐指数
2
解决办法
2万
查看次数

错误如何在Xcode 8 beta 4中的Swift中工作

似乎在将旧代码转换为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'的条件转换总是成功的"

swift3 xcode8-beta4

21
推荐指数
3
解决办法
1万
查看次数

GIDSignIn钥匙串错误iOS 10 Xcode 8

在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 keychain gidsignin ios10 xcode8-beta4

15
推荐指数
1
解决办法
5454
查看次数

无法从iOS 10 beta上运行的iPad访问应用程序容器

我无法使用xcode为iOS 10 beta 4上的应用程序下载app容器.我正在使用后来的xcode(beta 4).当我连接我的设备并进入Devicexcode时,我能够看到我的应用程序列出,但当我点击下载容器时,我得到以下错误:

在此输入图像描述

是否与我的应用设置或设备设置有关.如何获取iOS10 beta 4的应用数据.

appcontainer ios10 xcode8-beta4

13
推荐指数
1
解决办法
5124
查看次数

多重连接未以编程方式连接

我正在创建一个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

11
推荐指数
4
解决办法
8843
查看次数

使用未声明类型'AttributedString'

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中的一些源代码错误?

xcode swift swift3 xcode8-beta4

8
推荐指数
1
解决办法
1494
查看次数

Xcode 8 beta 4:在物理设备上运行时"无法附加到pid:1110"

我做了一个消息扩展,当我在iOS模拟器上运行时,一切都没有问题.当我尝试在手机上运行它时,它会编译并说在崩溃之前运行大约5秒并在Xcode中给我一个弹出消息说Could not attach to pid这是一个截图:

我得到的错误

我在iOS 10中使用Xcode 8 beta 4.一切都在模拟器中运行良好,这是在物理设备上.我重新启动并重新启动了一切.我甚至试过两部手机.谁知道解决方案?

谢谢

xcode swift ios10 xcode8-beta4

4
推荐指数
1
解决办法
4450
查看次数