让CFNotificationCenterAddObserver在Swift中工作让我大吃一惊。CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(),UnsafePointer(self),iosLocked,"com.apple.springboard.lockcomputer"asCFString,nil,CFNotificationSuspensionBehavior.DeliverImmediately)iOSdocs列出它,我已经在回调和不安全指针上尝试了无数次迭代,但没有成功。