         
         self.resultSearchController = ({
             let controller = UISearchController(searchResultsController: nil)
+            controller.delegate = self
             controller.searchResultsUpdater = self
             controller.dimsBackgroundDuringPresentation = false
             controller.searchBar.delegate = self


import UIKit

class MasterViewController: UITableViewController, UISearchResultsUpdating,UISearchBarDelegate, NpmDataSourceDelegate {

    var detailViewController: DetailViewController? = nil
    var objects = NSArray()

             self.performSegueWithIdentifier("showDetail", sender: nil)
        }
    }
    
    func willPresentSearchController(searchController: UISearchController) {
        if(filteredTableData.count > 0){
            objects = NSArray()
            filteredTableData.removeAll(keepCapacity: false)
            self.resultSearchController.searchBar.text = ""
            self.reloadTable()
        }
    }

    func updateSearchResultsForSearchController(searchController: UISearchController)
    {
