我在Xcode 8 Beta 3中有一个Objective-C项目.自更新以来,每当我尝试构建时,都会收到以下错误:
对于使用Swift的目标,需要正确配置"使用Legacy Swift语言版本"(SWIFT_VERSION).使用[Edit> Convert> To Current Swift Syntax ...]菜单选择Swift版本或使用Build Settings编辑器直接配置构建设置.
有没有遇到过这个?由于它是一个Objective-C项目,因此没有构建设置来配置Swift.我还确保没有项目依赖项或CocoaPods使用Swift.我唯一的解决方案是使用Beta 2.任何想法如何解决这个问题?
我还应该提到我正在运行OSX 10.12 Beta 2.
为了以防万一,我们可以通过重置内容和设置来删除应用程序,但也可以从Xcode 7中的模拟器中删除单个应用程序.Xcode 8中不是这种情况.如何实现?我有一个强制触摸触控板,是否会影响从模拟器中删除应用程序?
我需要安排一个Timer来每秒触发一个函数,但是我发现在xcode 8 beta 3中,scheduledTimer仅适用于iOS 10.在iOS 9或之前版本中使用计时器有没有其他选择?
Timer.scheduledTimer(withTimeInterval: 1, repeats: true, block: { (timer) in print("Hi!")})
Run Code Online (Sandbox Code Playgroud) 我需要在Swift 3.0中实现这个Objective-C代码(我正在使用Xcode 8 Beta 3):
// Note: this code comes from an Obj-C category on UIImage
CGImageRef imageRef = CGImageCreateWithImageInRect(self.CGImage, cropRect);
UIImage *image = [UIImage imageWithCGImage:imageRef scale:self.scale orientation:self.imageOrientation];
Run Code Online (Sandbox Code Playgroud)
我在最新的文档中找不到任何内容CGImageCreateWithImageInRect()
.
如果应用程序未处于活动状态(甚至不在后台或已终止),则在3D Touch之后单击"通知中的操作按钮聊天"时不会调用UNUserNotificationCenter功能.我在Xcode中使用"附加到名称处理"来在应用程序终止时调试应用程序.这是代码:
import UIKit
import Mixpanel
import UserNotifications
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
//setup mixpanel
self.handlePushNotificationWithUserInfo(launchOptions: launchOptions)
//ask for push notification perms
return true
}
Run Code Online (Sandbox Code Playgroud)
当通知弹出窗口(从MixPanel发送)时,首先调用此函数,
致电1:
func handlePushNotificationWithUserInfo(launchOptions: [NSObject: AnyObject]?) {
//Handle PushNotification when app is opened
}
Run Code Online (Sandbox Code Playgroud)
然后它就在这里,
电话2:
//register for notification
func application(_ application: UIApplication, didRegister notificationSettings: UIUserNotificationSettings) {
if #available(iOS 10.0, *) {
let center = UNUserNotificationCenter.current() …
Run Code Online (Sandbox Code Playgroud) 我希望能够在Playgrounds中轻松构建我的Sprite Kit代码原型.这在Xcode 7中工作正常
import UIKit
import SpriteKit
import XCPlayground
let sceneView = SKView(frame: CGRect(x:0 , y:0, width: 480, height: 320))
let scene = SKScene(size: CGSize(width: 480, height: 320))
sceneView.showsFPS = true
sceneView.presentScene(scene)
XCPlaygroundPage.currentPage.liveView = sceneView
let square = SKSpriteNode(imageNamed: "square")
square.name = "shape"
square.position = CGPoint(x: scene.size.width * 0.25, y: scene.size.height * 0.5)
let circle = SKSpriteNode(imageNamed: "circle")
circle.name = "shape"
circle.position = CGPoint(x: scene.size.width * 0.50, y: scene.size.height * 0.5)
let triangle = SKSpriteNode(imageNamed: "triangle")
triangle.name = "shape"
triangle.position …
Run Code Online (Sandbox Code Playgroud) 我已经下载了3次.徒步旅行两次,镀铬一次.
每次我都无法使用默认工具或Unarchiver取消归档.
基于这个苹果开发者线程,我试过:
$ xar -xf Xcode_8_beta_3\ \(1\).xip
Error while extracting archive:(Content): archived-checksum sha1's do not match (No such file or directory)
Run Code Online (Sandbox Code Playgroud)
然后:
$ cpio -it < Xcode_8_beta_3\ \(1\).xip
Content
cpio: Truncated input file (needed 4433260676 bytes, only 4433260317 available): Unknown error: -1
Run Code Online (Sandbox Code Playgroud)
我的驱动器上有25个可用空间,存在此文件(但如果是磁盘空间问题,为什么说我的压缩存档太小了〜250个字节?)
我正在使用OSX 10.11.4
谁知道发生了什么事?
xcode8-beta3 ×8
ios10 ×3
swift ×3
swift3 ×3
xcode8 ×3
ios ×2
cgimage ×1
force-touch ×1
ios9 ×1
sprite-kit ×1
xar ×1
xcode ×1