swift - Button on Table View Cell connected to local function -


i have table view cell loaded data parse request. loads "friend requests", showing requesting friends name , 2 buttons, "accept" , "reject"

here cellforrowatindexpath func:

func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell {      let cell:notifications_jlr_cell = self.tableview.dequeuereusablecellwithidentifier("cell") as! notifications_jlr_cell      cell.txtrequestdesc.text = searchresults[indexpath.row].requesteename + " has requested friend"      cell.btnapprove_outlet.addtarget(self, action:selector("approve"), forcontrolevents: uicontrolevents.touchupinside)      return cell } 

the table loads fine, , addtarget line, once "approve" button clicked, runs func:

func approve() {     println("approve") } 

however, when fetching parse data, have set in array, objectid friend request, want refer in approve() function

how can pass objectid string thats saved in array approve() function when there no "withobject" parameter in addtarget ?

i have seen similar question here suggests adding 2 button programatically, don't want because have programatically deal button constraints, pain if can somewhere pass parameter approve() function

(i cannot use .tag because accepts integers)


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -