2014-09-18 30 views
1

我試圖根據方向是在風景還是肖像中發射火焰。這是我正在使用的,但它給了我一個未經確認的選擇器錯誤。任何人都可以將我指向正確的方向嗎?斯威夫特,火焰在方位旋轉時延續

viewDidLoad(){ 
    UIDevice.currentDevice().beginGeneratingDeviceOrientationNotifications() 

    NSNotificationCenter.defaultCenter().addObserver(self, selector: "showScoreCard:", name: UIDeviceOrientationDidChangeNotification, object: nil) 

} 



func showScoreCard { 
    let deviceOrientation = UIDevice.currentDevice().orientation 

    if UIDeviceOrientationIsLandscape(deviceOrientation){ 
     self.performSegueWithIdentifier("scorecardSegue", sender: self) 

} 

回答

1

獲取你的showScoreCard字符串的結尾去掉結腸,因爲結腸表明,該方法接受一個參數。

+0

非常感謝!我不知道結腸的情況。你搖滾! – candidaMan 2014-09-19 04:39:43