Übergeben Sie mehrere Parameter an AddtargetIOS

Programmierung für iOS
Anonymous
 Übergeben Sie mehrere Parameter an Addtarget

Post by Anonymous »

in meinem UitableViewCell habe ich eine Schaltfläche. Und ich möchte eine Aktion hinzufügen, indem ich mehrere Parameter in CellForrowatIndexPath < /code> Methode übergeben kann. < /P>

Code: Select all

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("CartCell", forIndexPath:
indexPath) as! CartTableViewCell
cell.buyButton.addTarget(self, action: self.buyButton(indexPath, 2, 3 ,4 , 5, 6), forControlEvents: .TouchUpInside)
}

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post