2015-01-13 14 views
7

鉱山に最もよく似た質問がありましたが、完全には回答されていませんでした。もし誰かが私を助けることができれば素晴らしいだろう。私が同様の質問を見つけた場所はhereです。アクションの複数のパラメータ/引数 - Swift

func test()"test"となり、test(object:AnyObject)"test:"となります。 thisに感謝します。

どのように2つのパラメータは? '行動のための2つの議論をしないで速くすることができますか?'

func popoverSelectedCode (code:AnyObject, desc:AnyObject) 

は、私は以下のいくつかの異なる方法でそれをテストしようとしたが、無駄に:一週間の古いスウィフト約

action: "popoverSelectedCode:," 

action: "popoverSelectedCode:,:" 

action: "popoverSelectedCode: :" 

action: "popoverSelectedCode: , :" 

アムとても親切にしてください。ここでEDITED

はポップオーバーは、しかし、選択時に表示されるコード

@IBAction func securityQuestButtonClicked (sender:AnyObject) 
{ 
    cellButton = sender as? UIButton; 

    var comboDescListArray = TableRoutine.loadCombobox("MobileQuestion") 

    var codeObject : NSArray = comboDescListArray[0] as NSArray; 
    var descObject : NSArray = comboDescListArray[1] as NSArray; 

    var selectionTVC = CPSelectionTVC(style:UITableViewStyle.Plain, codeArray:codeObject, descArray:descObject, target:self, action: "popoverSelectedCode::", widthForViewInPopover:650) 

    let navCtl = UINavigationController.init(rootViewController:selectionTVC) 
    popoverController = UIPopoverController.init(contentViewController:navCtl) 

    var contentHeight : CGFloat = CGFloat (UInt(selectionTVC.navigationTitleHeight) + UInt(selectionTVC.rowCount()) * UInt(selectionTVC.cellHeight)) 

    popoverController?.popoverContentSize = CGSizeMake(400.0, contentHeight) 
    popoverController?.presentPopoverFromRect(sender.bounds, inView:sender as UIView, permittedArrowDirections:UIPopoverArrowDirection.Up, animated:true) 
} 

の短いクリップで、それだけでハングアップします。

+0

回答がありましたか?私は同じ問題に取り組んでいます。もしそうなら、あなたは複数のパラメータでセレクタを書いていましたが、どのようにアクション関数がどのようになっていますか?ありがとう。 –

+0

残念ながら、私は他のことで忙しかったですが、今日は新しい答えを探していました。あなたが答えを見つけた場合は、私をつけてください。 –

答えて

関連する問題