首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SpringBoard意外退出

SpringBoard意外退出
EN

Stack Overflow用户
提问于 2017-10-28 14:28:06
回答 2查看 3.3K关注 0票数 0

有没有人能帮我解决下面的问题?每次当我尝试触摸并向下滑动通知时。我得到以下错误,iOS模拟器重新启动。我试着重装Xcode,但没有任何帮助。我尝试了不同版本的模拟器。从iphone 6到iphone 8

代码语言:javascript
复制
Process:               SpringBoard [5139]
Path:                  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/CoreServices/SpringBoard.app/SpringBoard
Identifier:            SpringBoard
Version:               1.0 (50)
Code Type:             X86-64 (Native)
Parent Process:        launchd_sim [4875]
Responsible:           SpringBoard [5139]
User ID:               501

Date/Time:             2017-10-28 08:09:15.159 +0200
OS Version:            Mac OS X 10.13 (17A405)
Report Version:        12
Anonymous UUID:        CF9C10C7-F4C9-1CC8-7D45-E336797E531B

Sleep/Wake UUID:       CE87E042-97E5-49EF-8466-B49FDB0354A9

Time Awake Since Boot: 47000 seconds
Time Since Wake:       630 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Failed to receive a participant from the arbiter'
terminating with uncaught exception of type NSException
abort() called
CoreSimulator 494.22.3 - Device: iPhone 8 - Runtime: iOS 11.0 (15A8401) - DeviceType: iPhone 8

下面是我的viewController代码

代码语言:javascript
复制
class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // 1. REQUEST PERMISSION
        UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { (granted, error) in
            if granted {
                print("Notification access granted")
            } else {
                print(error?.localizedDescription as Any)
            }
        }

    }

    @IBAction func notoify(_ sender: UIButton) {
        scheduleNotification(inSeconds: 5, completion: {
            success in if success {
                print("Ok")
            } else {
                print("Error scheduled notification")
            }

        })
    }

    func scheduleNotification(inSeconds: TimeInterval, completion: @escaping (_ Success: Bool) -> ()){

        let notification = UNMutableNotificationContent()
        notification.title =  "Notification"
        notification.subtitle =  "These are great"
        notification.body = "Test test test test test test test test"

        let notificationTrigger = UNTimeIntervalNotificationTrigger(timeInterval: inSeconds, repeats: false)

        let notificationRequest = UNNotificationRequest(identifier: "myNotification", content: notification, trigger: notificationTrigger)

        UNUserNotificationCenter.current().add(notificationRequest, withCompletionHandler: {
            error in if error != nil {
                print(error as Any)
                completion(false)
            }
            else {
                completion(true)
            }
        })

    }

}
EN

回答 2

Stack Overflow用户

发布于 2020-05-09 21:22:46

我最近在将我的xcode更新到11.4.1版本后遇到了这个问题。我解决这个问题的唯一方法是完全卸载xcode并重新安装它。重新安装完成后,我再也没有看到这个错误,我所有的Flutter和其他移动项目都可以正常工作,没有任何问题。

票数 0
EN

Stack Overflow用户

发布于 2020-05-13 19:52:28

在经历了完全相同的问题后,完全卸载XCode并重新安装对我来说也是有效的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46986921

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档