0

I used an iBeacon Library in Swift,

// Listening Notifications
func registerNotifications() {
    NSNotificationCenter.defaultCenter().addObserver(self, selector: Selector.convertFromStringLiteral("handleNotification:"), name: kBUOYDidFindBeaconNotification, object: nil)
}

After used the iOS8.1 SDK, the editor said:

'Selector.Type' does not have a member named 'convertFromStringLiteral'

How can I solve this problem? I tried the following code but not working.

 Selector("handleNotification:")
Alex Wu
  • 23
  • 3

1 Answers1

0

Just write the string without Selector:

NSNotificationCenter.defaultCenter().addObserver(self, selector: "handleNotification:", name: kBUOYDidFindBeaconNotification, object: nil)
Yonat
  • 4,382
  • 2
  • 28
  • 37