我将假设您正在使用情节提要。如果我是正确的话,那么您的问题是,
secondController在您的“第一个控制器”中创建的“”不是您要演示的实际内容。您将需要设置
secondController你的
prepareForSegue:
第二控制人
不变的
第一控制人
class ViewController: UIViewController, testProtocol { // you will want to add the ? since this variable is now optional (i.e. can be nil) var secondController: SecondViewController? // don't assign it a value yet // ... // implementation of the protocol func testDelegate() { println("Hello delegate") } // your prepare for segue override func prepareForSegue(segue: UIStoryboardSegue?, sender: AnyObject?) { // get the controller that storyboard has instantiated and set it's delegate secondController = segue!.destinationViewController as? SecondViewController secondController!.delegate = self; }}


