我用了斯威夫特的iBeacon图书馆,
// Listening Notifications
func registerNotifications() {
NSNotificationCenter.defaultCenter().addObserver(self, selector: Selector.convertFromStringLiteral("handleNotification:"), name: kBUOYDidFindBeaconNotification, object: nil)
}在使用了iOS8.1SDK之后,编辑说:
'Selector.Type' does not have a member named 'convertFromStringLiteral'我该如何解决这个问题?我尝试了下面的代码,但不起作用。
Selector("handleNotification:")发布于 2014-11-06 07:09:23
只需编写不带Selector的字符串:
NSNotificationCenter.defaultCenter().addObserver(self, selector: "handleNotification:", name: kBUOYDidFindBeaconNotification, object: nil)https://stackoverflow.com/questions/26773476
复制相似问题