Since moving to Xcode 6 Beta 6 attempting to use MPMoviePlayerPlaybackDidFinishNotification in Swift code results in a linker error:
Undefined symbols for architecture arm64:
"__TFSs26_forceBridgeFromObjectiveCU__FTPSs9AnyObject_MQ__Q_",
Here's a relevant code snippet.
import MediaPlayer
class ViewControllerController : NSObject, MFMessageComposeViewControllerDelegate, MFMailComposeViewControllerDelegate {
func thisWontLink () -> Void {
NSNotificationCenter.defaultCenter().addObserver(self, selector: "nothing:", name: MPMoviePlayerPlaybackDidFinishNotification, object: nil);
}
func nothing() -> Void {
}
Replacing MPMoviePlayerPlaybackDidFinishNotification with "Some Random string" will result in the linker error going away. The app is linking with MediaPlayer.framework.
This only seems to be an issue using MPMoviePlayerPlaybackDidFinishNotification in combination with addObserver, for example assigning it to a varaible or printlning it doesn't result in the linker error.
Anything wrong with the code or is it an issue with XCode/swift?