SourceKitService在Xcode 6.1.1中崩溃

时间:2014-12-23 08:41:21

标签: ios xcode swift ios8 xcode6

我开始遇到 Xcode 6.0.1 的问题,其中错误"SourceKitService Crashed Crashlog generated in ~/Library/Logs/DiagnosticReports"开始弹出,并且所有语法突出显示都在Swift中消失了。然后Apple发布了一个新的更新 Xcode 6.1.1 ,其中提到此问题已得到解决。所以我将我的Xcode更新为6.1.1,但这个问题仍然存在。我的情况是问题只是停留在那里而且永远不会消失。

enter image description here

我尝试在StackOverflow中找到的解决方案很少,例如删除DerivedData/ModuleCache的内容,清理项目等但问题仍然存在。

我无法进行构建,每当我尝试获取这两个错误时。

/Users/MY_PROJECT/AppDelegate.swift:11:1: 'UIApplicationMain' class must conform to the 'UIApplicationDelegate'
我的AppDelegate.h文件中的UIApplicationMain上的

协议,此命令因信号失败而失败:Segmentation fault: 11

以下是我的AppDelegate.swift的代码

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?


func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool {
    return true
}

func applicationWillResignActive(application: UIApplication!) {
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

func applicationDidEnterBackground(application: UIApplication!) {
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

func applicationWillEnterForeground(application: UIApplication!) {
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

func applicationDidBecomeActive(application: UIApplication!) {
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

func applicationWillTerminate(application: UIApplication!) {
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}


}

1 个答案:

答案 0 :(得分:0)

我不确定此错误的原因,我因各种原因导致此源程序包崩溃。对于您,如果您查看UIApplicationDelegate方法,它们会在签名中略有变化。例如,UIApplication参数现在不是可选的。

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        // Override point for customization after application launch.
        return true
    }

因此,如果您将委托方法与新的UIApplicationDelegate方法进行比较(如果您命令+单击,则可以检查方法签名)并进行更改,您可以摆脱此错误。试一下。