UIBarButton not changing
问题 @IBOutlet weak var playStopButton: UIBarButtonItem! var playStopArray = [UIBarButtonSystemItem.Pause, UIBarButtonSystemItem.Play] var index = 0 @IBOutlet weak var image: UIImageView! @IBAction func playButton(sender: UIBarButtonItem) { println("pressed") playStopButton = UIBarButtonItem(barButtonSystemItem: playStopArray[index], target: self, action: "startMusic:") println("here") if index == 0 { index = 1 } else { index = 0 } } func startMusic() { println("test") } I expected the bar button