【问题标题】:SpringBoard quit unexpectedlySpringBoard 意外退出
【发布时间】:2017-10-28 06:28:05
【问题描述】:

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

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 代码

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)
            }
        })

    }

}

【问题讨论】:

  • cd Library/Developer/Xcode/DerivedData,删除整个文件然后重启Xcode。
  • 它没有帮助:(
  • 你找到解决办法了吗?

标签: ios iphone swift push-notification nsnotificationcenter


【解决方案1】:

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

【讨论】:

    【解决方案2】:

    在遇到完全相同的问题后,完全卸载 XCode 并重新安装也对我有用。

    【讨论】:

      猜你喜欢
      • 2020-10-03
      • 1970-01-01
      • 2013-10-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-27
      • 2021-03-13
      相关资源
      最近更新 更多