ios - lldb error when trying to segue SWIFT -



ios - lldb error when trying to segue SWIFT -

i next tutorial http://www.raywenderlich.com/76519/add-table-view-search-swift when ran error. adding feature app working on. 1 time in booths table view, want able navigate out main menu button on navigation bar. here section of code deals segues.

override func tableview(tableview: uitableview, didselectrowatindexpath indexpath: nsindexpath) { self.performseguewithidentifier("boothdetail", sender: tableview) } override func prepareforsegue(segue: uistoryboardsegue, sender: anyobject!) { if segue.identifier == "boothdetail" { allow boothdetailviewcontroller = segue.destinationviewcontroller uiviewcontroller if sender uitableview == self.searchdisplaycontroller!.searchresultstableview { allow indexpath = self.searchdisplaycontroller!.searchresultstableview.indexpathforselectedrow()! allow destinationtitle = self.filteredbooths[indexpath.row].name boothdetailviewcontroller.title = destinationtitle } else { allow indexpath = self.tableview.indexpathforselectedrow()! allow destinationtitle = self.booths[indexpath.row].name boothdetailviewcontroller.title = destinationtitle } } }

}

the error thrown while trying utilize button on booths list direct show segue main conference menu. error on line.

if sender uitableview == self.searchdisplaycontroller!.searchresultstableview {

you have quite few problems. fatal, headache.

the first headache calling same segue twice. both functions phone call same segue. both execute. if want double animation, okay. since 1 passes info , other not, may have issue. eliminate didselectrowatindexpath function.

in prepareforsegue method appears have 2 different objects connected same segue. searchdisplaycontroller , tableview. want 2 separate segues. if/else makes changes based on segue chosen:

override func prepareforsegue(segue: uistoryboardsegue, sender: anyobject?) { if segue.identifier == "segue1" { //code set 1 } else if segue.identifier == "segue2" { //code set 2 } }

ios button swift back sender

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -