Swift 3:搜索栏系统组容器调试器输出

时间:2017-01-18 05:50:09

标签: ios swift3 uisearchbar

我正在开发一款使用少量搜索栏的iOS应用。每当用户点击任何搜索栏时,我都会在调试器中看到下面的输出:

[MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
[MC] Reading from public effective user settings.

这是我应该关注的事情,如果有的话,是否有解决方法呢?

编辑 - 其中一个ViewControllers可以在下面看到:

FollowersViewController: UIViewController, UISearchBarDelegate {

    @IBOutlet weak var searchBar: UISearchBar!
    var followersConstant = User.generateUserArray() 
    var followers = [User]()
    ...

    override func viewDidLoad() {
        super.viewDidLoad()

        searchBar.delegate = self
        searchBar.returnKeyType = .done
        searchBar.backgroundImage = UIImage()
        searchBar.enablesReturnKeyAutomatically = false

        followers = followersConstant
    }

    //MARK: searchBar functions
    func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) {
        if searchText.isEmpty {
            followers = followersConstant
            self.tableView.reloadData()
        } else {
            filterTableView(text: searchText)
        }
    }

    func searchBarSearchButtonClicked(_ searchBar: UISearchBar)
    {
        self.searchBar.endEditing(true)
    }

    func filterTableView (text: String) {
        followers = followersConstant.filter { (name) -> Bool in
            return (name.userName?.lowercased().contains(text.lowercased()))!
        }
        self.tableView.reloadData()
    }
}

0 个答案:

没有答案