Error[8]: Undefined offset: 2, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

概述我在使用Swift 2.0的iOS 9中遇到了一个奇怪的问题.我在tableViewController中添加了UISearchController但它会导致一个奇怪的黑屏问题.当我按下搜索栏并写一些东西时,它显示我的过滤结果没有任何问题,但当我点击另一个标签栏按钮,如书签,然后当我点击tableViewController再次观看时,它显示黑屏像屏幕截图. 有我的tableViewControl 我在使用Swift 2.0的iOS 9中遇到了一个奇怪的问题.我在tableVIEwController中添加了UISearchController但它会导致一个奇怪的黑屏问题.当我按下搜索栏并写一些东西时,它显示我的过滤结果没有任何问题,但当我点击另一个标签栏按钮,如书签,然后当我点击tableVIEwController再次观看时,它显示黑屏像屏幕截图.

有我的tableVIEwController;

import UIKitclass CitIEstableVIEwController: UItableVIEwController,UISearchResultsUpdating {// MARK: - Class PropertIEsprivate var citIEs = [String]()private var veterinarIEs = [Veterinary]()private var filteredVeterinarIEs = [Veterinary]()private var resultSearchController: UISearchController!// MARK: - tableVIEwController life Cycle MethodsoverrIDe func vIEwDIDLoad() {    super.vIEwDIDLoad()    self.getCitIEsList()    self.configureResultsSearchController()}overrIDe func vIEwDIDdisappear(animated: Bool) {    super.vIEwDIDdisappear(animated)    self.resultSearchController.active = false}// MARK: - Configuring Search bar Controllerprivate func configureResultsSearchController() {    self.resultSearchController = UISearchController(searchResultsController: nil)    self.resultSearchController.searchResultsUpdater = self    self.resultSearchController.dimsBackgroundDuringPresentation = false    self.resultSearchController.hIDesNavigationbarDuringPresentation = false    self.resultSearchController.searchbar.sizetoFit()    self.resultSearchController.searchbar.placeholder = "Klinik veya ilçe adı"    self.tableVIEw.tableheaderVIEw = self.resultSearchController.searchbar}// MARK: - table vIEw data sourceoverrIDe func numberOfSectionsIntableVIEw(tableVIEw: UItableVIEw) -> Int { return 1 }overrIDe func tableVIEw(tableVIEw: UItableVIEw,numberOfRowsInSection section: Int) -> Int {    if self.resultSearchController.active { return self.filteredVeterinarIEs.count }    else { return self.citIEs.count }}// MARK: - table vIEw Delegate MethodsoverrIDe func tableVIEw(tableVIEw: UItableVIEw,dIDSelectRowAtIndexPath indexPath: NSIndexPath) {    if (self.resultSearchController.active) {        self.performSegueWithIDentifIEr(Constants.ShowDetailVIEwControllerSegueIDentifIEr,sender: nil)    } else {        self.performSegueWithIDentifIEr(Constants.ShowTownstableVIEwControllerSegueIDentifIEr,sender: nil)    }}overrIDe func tableVIEw(tableVIEw: UItableVIEw,cellForRowAtIndexPath indexPath: NSIndexPath) -> UItableVIEwCell {    let cell = tableVIEw.dequeueReusableCellWithIDentifIEr(Constants.CellIDentifIEr,forIndexPath: indexPath)    if (self.resultSearchController.active) {        cell.textLabel?.text = self.filteredVeterinarIEs[indexPath.row].name        cell.detailTextLabel?.text = self.filteredVeterinarIEs[indexPath.row].address        return cell    } else {        cell.textLabel?.text = self.citIEs[indexPath.row]        return cell    }}// MARK: - PARSE query Methodsprivate func getCitIEsList() {    let parseQuerIEs = ParseQuerIEs()    parseQuerIEs.downloadListData() {        (let parseResults) in        if let veterinarIEs = parseResults as? [Veterinary] {            self.veterinarIEs = veterinarIEs            for vet in veterinarIEs {                if let city = vet.city {                    self.citIEs.append(city)                }            }            dispatch_async(dispatch_get_main_queue()) {                self.citIEs = HelperMethods().removeDuplicatesAndSort(array: self.citIEs)                self.tableVIEw.reloadData()            }        }    }}// MARK: - UISearchController Delegate Methodsfunc updateSearchResultsForSearchController(searchController: UISearchController) {    self.filteredVeterinarIEs.removeAll(keepCapacity: false)    if let searchbarText = searchController.searchbar.text{        let searchText = searchbarText.lowercaseString        // Searching with Veterinary name and Veterinary City        self.filteredVeterinarIEs = self.veterinarIEs.filter({
self.definesPresentationContext = true
.name?.lowercaseString.rangeOfString(searchText) != nil}) self.filteredVeterinarIEs += self.veterinarIEs.filter({[+++].town?.lowercaseString.rangeOfString(searchText) != nil}) tableVIEw.reloadData() }}

这是来自iOS 9模拟器的黑屏图像,与真实设备相同.

当我点击searchbar并且它无法再次启动时,我认为它会消除我的tableVIEw.这是一个错误还是什么?

我怎么解决这个问题 ?

谢谢 !

解决方法 朋友,在你的vIEwDIDLoad()中插入以下代码行:

[+++]

看看我如何放(第29行):

click here to see

总结

以上是内存溢出为你收集整理的ios – UISearchController导致黑屏Swift 2.0全部内容,希望文章能够帮你解决ios – UISearchController导致黑屏Swift 2.0所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 165, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
Error[8]: Undefined offset: 3, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 121
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

概述我在使用Swift 2.0的iOS 9中遇到了一个奇怪的问题.我在tableViewController中添加了UISearchController但它会导致一个奇怪的黑屏问题.当我按下搜索栏并写一些东西时,它显示我的过滤结果没有任何问题,但当我点击另一个标签栏按钮,如书签,然后当我点击tableViewController再次观看时,它显示黑屏像屏幕截图. 有我的tableViewControl 我在使用Swift 2.0的iOS 9中遇到了一个奇怪的问题.我在tableVIEwController中添加了UISearchController但它会导致一个奇怪的黑屏问题.当我按下搜索栏并写一些东西时,它显示我的过滤结果没有任何问题,但当我点击另一个标签栏按钮,如书签,然后当我点击tableVIEwController再次观看时,它显示黑屏像屏幕截图.

有我的tableVIEwController;

import UIKitclass CitIEstableVIEwController: UItableVIEwController,UISearchResultsUpdating {// MARK: - Class PropertIEsprivate var citIEs = [String]()private var veterinarIEs = [Veterinary]()private var filteredVeterinarIEs = [Veterinary]()private var resultSearchController: UISearchController!// MARK: - tableVIEwController life Cycle MethodsoverrIDe func vIEwDIDLoad() {    super.vIEwDIDLoad()    self.getCitIEsList()    self.configureResultsSearchController()}overrIDe func vIEwDIDdisappear(animated: Bool) {    super.vIEwDIDdisappear(animated)    self.resultSearchController.active = false}// MARK: - Configuring Search bar Controllerprivate func configureResultsSearchController() {    self.resultSearchController = UISearchController(searchResultsController: nil)    self.resultSearchController.searchResultsUpdater = self    self.resultSearchController.dimsBackgroundDuringPresentation = false    self.resultSearchController.hIDesNavigationbarDuringPresentation = false    self.resultSearchController.searchbar.sizetoFit()    self.resultSearchController.searchbar.placeholder = "Klinik veya ilçe adı"    self.tableVIEw.tableheaderVIEw = self.resultSearchController.searchbar}// MARK: - table vIEw data sourceoverrIDe func numberOfSectionsIntableVIEw(tableVIEw: UItableVIEw) -> Int { return 1 }overrIDe func tableVIEw(tableVIEw: UItableVIEw,numberOfRowsInSection section: Int) -> Int {    if self.resultSearchController.active { return self.filteredVeterinarIEs.count }    else { return self.citIEs.count }}// MARK: - table vIEw Delegate MethodsoverrIDe func tableVIEw(tableVIEw: UItableVIEw,dIDSelectRowAtIndexPath indexPath: NSIndexPath) {    if (self.resultSearchController.active) {        self.performSegueWithIDentifIEr(Constants.ShowDetailVIEwControllerSegueIDentifIEr,sender: nil)    } else {        self.performSegueWithIDentifIEr(Constants.ShowTownstableVIEwControllerSegueIDentifIEr,sender: nil)    }}overrIDe func tableVIEw(tableVIEw: UItableVIEw,cellForRowAtIndexPath indexPath: NSIndexPath) -> UItableVIEwCell {    let cell = tableVIEw.dequeueReusableCellWithIDentifIEr(Constants.CellIDentifIEr,forIndexPath: indexPath)    if (self.resultSearchController.active) {        cell.textLabel?.text = self.filteredVeterinarIEs[indexPath.row].name        cell.detailTextLabel?.text = self.filteredVeterinarIEs[indexPath.row].address        return cell    } else {        cell.textLabel?.text = self.citIEs[indexPath.row]        return cell    }}// MARK: - PARSE query Methodsprivate func getCitIEsList() {    let parseQuerIEs = ParseQuerIEs()    parseQuerIEs.downloadListData() {        (let parseResults) in        if let veterinarIEs = parseResults as? [Veterinary] {            self.veterinarIEs = veterinarIEs            for vet in veterinarIEs {                if let city = vet.city {                    self.citIEs.append(city)                }            }            dispatch_async(dispatch_get_main_queue()) {                self.citIEs = HelperMethods().removeDuplicatesAndSort(array: self.citIEs)                self.tableVIEw.reloadData()            }        }    }}// MARK: - UISearchController Delegate Methodsfunc updateSearchResultsForSearchController(searchController: UISearchController) {    self.filteredVeterinarIEs.removeAll(keepCapacity: false)    if let searchbarText = searchController.searchbar.text{        let searchText = searchbarText.lowercaseString        // Searching with Veterinary name and Veterinary City        self.filteredVeterinarIEs = self.veterinarIEs.filter({
self.definesPresentationContext = true
.name?.lowercaseString.rangeOfString(searchText) != nil}) self.filteredVeterinarIEs += self.veterinarIEs.filter({.town?.lowercaseString.rangeOfString(searchText) != nil}) tableVIEw.reloadData() }}

这是来自iOS 9模拟器的黑屏图像,与真实设备相同.

当我点击searchbar并且它无法再次启动时,我认为它会消除我的tableVIEw.这是一个错误还是什么?

我怎么解决这个问题 ?

谢谢 !

解决方法 朋友,在你的vIEwDIDLoad()中插入以下代码行:

[+++]

看看我如何放(第29行):

click here to see

总结

以上是内存溢出为你收集整理的ios – UISearchController导致黑屏Swift 2.0全部内容,希望文章能够帮你解决ios – UISearchController导致黑屏Swift 2.0所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 165, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
ios – UISearchController导致黑屏Swift 2.0_app_内存溢出

ios – UISearchController导致黑屏Swift 2.0

ios – UISearchController导致黑屏Swift 2.0,第1张

概述我在使用Swift 2.0的iOS 9中遇到了一个奇怪的问题.我在tableViewController中添加了UISearchController但它会导致一个奇怪的黑屏问题.当我按下搜索栏并写一些东西时,它显示我的过滤结果没有任何问题,但当我点击另一个标签栏按钮,如书签,然后当我点击tableViewController再次观看时,它显示黑屏像屏幕截图. 有我的tableViewControl 我在使用Swift 2.0的iOS 9中遇到了一个奇怪的问题.我在tableVIEwController中添加了UISearchController但它会导致一个奇怪的黑屏问题.当我按下搜索栏并写一些东西时,它显示我的过滤结果没有任何问题,但当我点击另一个标签栏按钮,如书签,然后当我点击tableVIEwController再次观看时,它显示黑屏像屏幕截图.

有我的tableVIEwController;

import UIKitclass CitIEstableVIEwController: UItableVIEwController,UISearchResultsUpdating {// MARK: - Class PropertIEsprivate var citIEs = [String]()private var veterinarIEs = [Veterinary]()private var filteredVeterinarIEs = [Veterinary]()private var resultSearchController: UISearchController!// MARK: - tableVIEwController life Cycle MethodsoverrIDe func vIEwDIDLoad() {    super.vIEwDIDLoad()    self.getCitIEsList()    self.configureResultsSearchController()}overrIDe func vIEwDIDdisappear(animated: Bool) {    super.vIEwDIDdisappear(animated)    self.resultSearchController.active = false}// MARK: - Configuring Search bar Controllerprivate func configureResultsSearchController() {    self.resultSearchController = UISearchController(searchResultsController: nil)    self.resultSearchController.searchResultsUpdater = self    self.resultSearchController.dimsBackgroundDuringPresentation = false    self.resultSearchController.hIDesNavigationbarDuringPresentation = false    self.resultSearchController.searchbar.sizetoFit()    self.resultSearchController.searchbar.placeholder = "Klinik veya ilçe adı"    self.tableVIEw.tableheaderVIEw = self.resultSearchController.searchbar}// MARK: - table vIEw data sourceoverrIDe func numberOfSectionsIntableVIEw(tableVIEw: UItableVIEw) -> Int { return 1 }overrIDe func tableVIEw(tableVIEw: UItableVIEw,numberOfRowsInSection section: Int) -> Int {    if self.resultSearchController.active { return self.filteredVeterinarIEs.count }    else { return self.citIEs.count }}// MARK: - table vIEw Delegate MethodsoverrIDe func tableVIEw(tableVIEw: UItableVIEw,dIDSelectRowAtIndexPath indexPath: NSIndexPath) {    if (self.resultSearchController.active) {        self.performSegueWithIDentifIEr(Constants.ShowDetailVIEwControllerSegueIDentifIEr,sender: nil)    } else {        self.performSegueWithIDentifIEr(Constants.ShowTownstableVIEwControllerSegueIDentifIEr,sender: nil)    }}overrIDe func tableVIEw(tableVIEw: UItableVIEw,cellForRowAtIndexPath indexPath: NSIndexPath) -> UItableVIEwCell {    let cell = tableVIEw.dequeueReusableCellWithIDentifIEr(Constants.CellIDentifIEr,forIndexPath: indexPath)    if (self.resultSearchController.active) {        cell.textLabel?.text = self.filteredVeterinarIEs[indexPath.row].name        cell.detailTextLabel?.text = self.filteredVeterinarIEs[indexPath.row].address        return cell    } else {        cell.textLabel?.text = self.citIEs[indexPath.row]        return cell    }}// MARK: - PARSE query Methodsprivate func getCitIEsList() {    let parseQuerIEs = ParseQuerIEs()    parseQuerIEs.downloadListData() {        (let parseResults) in        if let veterinarIEs = parseResults as? [Veterinary] {            self.veterinarIEs = veterinarIEs            for vet in veterinarIEs {                if let city = vet.city {                    self.citIEs.append(city)                }            }            dispatch_async(dispatch_get_main_queue()) {                self.citIEs = HelperMethods().removeDuplicatesAndSort(array: self.citIEs)                self.tableVIEw.reloadData()            }        }    }}// MARK: - UISearchController Delegate Methodsfunc updateSearchResultsForSearchController(searchController: UISearchController) {    self.filteredVeterinarIEs.removeAll(keepCapacity: false)    if let searchbarText = searchController.searchbar.text{        let searchText = searchbarText.lowercaseString        // Searching with Veterinary name and Veterinary City        self.filteredVeterinarIEs = self.veterinarIEs.filter({
self.definesPresentationContext = true
.name?.lowercaseString.rangeOfString(searchText) != nil}) self.filteredVeterinarIEs += self.veterinarIEs.filter({.town?.lowercaseString.rangeOfString(searchText) != nil}) tableVIEw.reloadData() }}

这是来自iOS 9模拟器的黑屏图像,与真实设备相同.

当我点击searchbar并且它无法再次启动时,我认为它会消除我的tableVIEw.这是一个错误还是什么?

我怎么解决这个问题 ?

谢谢 !

解决方法 朋友,在你的vIEwDIDLoad()中插入以下代码行:

看看我如何放(第29行):

click here to see

总结

以上是内存溢出为你收集整理的ios – UISearchController导致黑屏Swift 2.0全部内容,希望文章能够帮你解决ios – UISearchController导致黑屏Swift 2.0所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1066209.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-26
下一篇 2022-05-26

发表评论

登录后才能评论

评论列表(0条)

保存