NSNotification 在尝试传回 userInfo 时中断 Swift

NSNotification breaking in Swift when trying to pass back userInfo

我在尝试通过 Swift 中的 postNotification 传回 userInfo 时遇到问题。奇怪的是代码只有在我尝试使用 userInfo 时才会中断——如果我 post 向没有参数的选择器发送没有数据的通知,一切正常。但是当我尝试传回 userInfo 时,出现 "unrecognized selector sent to instance" 错误。所以我 ViewController 中的选择器签名有问题,但我不知道是什么。

这是中断的代码:

在我的 table 视图中

let data = ["selection": selectedOption]
dismissViewControllerAnimated(true, completion: {NSNotificationCenter.defaultCenter().postNotificationName(wordsetPickedNotification, object: self, userInfo: data)})

在我的视图控制器中:

NSNotificationCenter.defaultCenter().addObserver(self, selector: "wordsetPicked", name: wordsetPickedNotification, object: nil)
...
func wordsetPicked(n:NSNotification) {
    //do stuff
}

selector: "wordsetPicked" 更改为 selector: "wordsetPicked:"