天道酬勤,学无止境

Typing in UISearchBar crashes my app

问题

更新 2

在用户点击 ViewController1 中的按钮后,我的应用程序在模态显示时崩溃。 在我的故事板中,我设置了一个标准的present modally segue 以弹出包含UISearchBar的 UINavController/UITableViewController 。 每次都这样失败。

但是,在我的AppDelegate中,如果我将窗口的rootViewController设置为相同的 UINavController/UITableViewController,一切都会按预期工作。

出于某种原因,通过 segue 转换然后执行 UISearchBar 会导致崩溃。

更新 1

点击一个字母时,我现在收到以下错误:

2015-02-03 12:23:35.262 Afar D[28348:2740681] -[NSNull length]: unrecognized selector sent to instance 0x10e352ce0
2015-02-03 12:23:40.313 Afar D[28348:2740681] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull length]: unrecognized selector sent to instance 0x10e352ce0'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010e0a9f35 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x000000010dd42bb7 objc_exception_throw + 45
    2   CoreFoundation                      0x000000010e0b104d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
    3   CoreFoundation                      0x000000010e00927c ___forwarding___ + 988
    4   CoreFoundation                      0x000000010e008e18 _CF_forwarding_prep_0 + 120
    5   CoreFoundation                      0x000000010df89a7b CFStringCompareWithOptionsAndLocale + 219
    6   Foundation                          0x000000010d6822b7 -[NSString compare:options:range:] + 29
    7   UIKit                               0x000000010c5f53b4 -[UIPhysicalKeyboardEvent _matchesKeyCommand:] + 224
    8   UIKit                               0x000000010c53c12e -[UIResponder(Internal) _keyCommandForEvent:] + 285
    9   UIKit                               0x000000010c53c197 -[UIResponder(Internal) _keyCommandForEvent:] + 390
    10  UIKit                               0x000000010c53c197 -[UIResponder(Internal) _keyCommandForEvent:] + 390
    11  UIKit                               0x000000010c53c197 -[UIResponder(Internal) _keyCommandForEvent:] + 390
    12  UIKit                               0x000000010c53c197 -[UIResponder(Internal) _keyCommandForEvent:] + 390
    13  UIKit                               0x000000010c53c197 -[UIResponder(Internal) _keyCommandForEvent:] + 390
    14  UIKit                               0x000000010c53c197 -[UIResponder(Internal) _keyCommandForEvent:] + 390
    15  UIKit                               0x000000010c53c197 -[UIResponder(Internal) _keyCommandForEvent:] + 390
    16  UIKit                               0x000000010c3d8f0a -[UIApplication _handleKeyUIEvent:] + 126
    17  UIKit                               0x000000010c5c7fcc -[UIKeyboardImpl _handleKeyEvent:executionContext:] + 66
    18  UIKit                               0x000000010c75bbb7 -[UIKeyboardLayoutStar completeRetestForTouchUp:timestamp:interval:executionContext:] + 3611
    19  UIKit                               0x000000010c75a8e5 -[UIKeyboardLayoutStar touchUp:executionContext:] + 1374
    20  UIKit                               0x000000010c5d531b __28-[UIKeyboardLayout touchUp:]_block_invoke + 242
    21  UIKit                               0x000000010cb23914 -[UIKeyboardTaskQueue continueExecutionOnMainThread] + 332
    22  UIKit                               0x000000010c5d521c -[UIKeyboardLayout touchUp:] + 252
    23  UIKit                               0x000000010c5d5cc6 -[UIKeyboardLayout touchesEnded:withEvent:] + 319
    24  UIKit                               0x000000010c40b308 -[UIWindow _sendTouchesForEvent:] + 735
    25  UIKit                               0x000000010c40bc33 -[UIWindow sendEvent:] + 683
    26  UIKit                               0x000000010c3d89b1 -[UIApplication sendEvent:] + 246
    27  UIKit                               0x000000010c3e5a7d _UIApplicationHandleEventFromQueueEvent + 17370
    28  UIKit                               0x000000010c3c1103 _UIApplicationHandleEventQueue + 1961
    29  CoreFoundation                      0x000000010dfdf551 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    30  CoreFoundation                      0x000000010dfd541d __CFRunLoopDoSources0 + 269
    31  CoreFoundation                      0x000000010dfd4a54 __CFRunLoopRun + 868
    32  CoreFoundation                      0x000000010dfd4486 CFRunLoopRunSpecific + 470
    33  GraphicsServices                    0x000000010fc109f0 GSEventRunModal + 161
    34  UIKit                               0x000000010c3c4420 UIApplicationMain + 1282
    35  My App                              0x000000010a5e1c63 main + 115
    36  libdyld.dylib                       0x000000010e75a145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

我正在使用 iOS8 的新UISearchController来管理UISearchBar以过滤表中的数据。 如果我激活UISearchBar ,只要我输入第一个字母,应用程序就会崩溃(有趣的是,屏幕键盘不会出现在模拟器中,但我认为这不相关)。

为了缩小范围,我已经注释掉了UIViewController中的几乎所有内容,以便UITableView不呈现任何内容。 我已经实现了UISearchControllerDelegateUISearchBarDelegate ,这样我就可以在调用每个方法时进行记录。 但是,在输入第一个字母后,我没有收到任何控制台消息。 我什至不知道我可以在哪里设置断点。

这是我得到的崩溃:

-[NSNull length]: unrecognized selector sent to instance 0x107602ce0

请注意,在我的文件中,我没有在任何地方调用长度。 幕后的东西是,但我不知道是什么。

这是我设置 UISearchController 的代码:

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.searchController = [[UISearchController alloc] initWithSearchResultsController:nil];
    self.searchController.searchResultsUpdater = self;
    self.searchController.definesPresentationContext = true;
    self.searchController.hidesNavigationBarDuringPresentation = false;
    [self.searchController.searchBar sizeToFit];
    self.tableView.tableHeaderView = self.searchController.searchBar;

    self.searchController.searchBar.delegate = self;
    self.searchController.delegate = self;
}

根据要求,这是我的委托方法(实施只是为了查看在输入第一个字母后是否调用了任何内容 - 他们没有):

#pragma mark - UISearchResultsUpdating

- (void)updateSearchResultsForSearchController:(UISearchController *)searchController
{
    NSLog(@"%s", __PRETTY_FUNCTION__);
}

#pragma mark - UISearchControllerDelegate

- (void)didDismissSearchController:(UISearchController *)searchController
{
    NSLog(@"%s", __PRETTY_FUNCTION__);
}

- (void)didPresentSearchController:(UISearchController *)searchController
{
    NSLog(@"%s", __PRETTY_FUNCTION__);
}

- (void)presentSearchController:(UISearchController *)searchController
{
    NSLog(@"%s", __PRETTY_FUNCTION__);
}

- (void)willDismissSearchController:(UISearchController *)searchController
{
    NSLog(@"%s", __PRETTY_FUNCTION__);
}

- (void)willPresentSearchController:(UISearchController *)searchController
{
    NSLog(@"%s", __PRETTY_FUNCTION__);
}

#pragma mark - UISearchBarDelegate

- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText
{
    NSLog(@"%s", __PRETTY_FUNCTION__);
}

- (BOOL)searchBar:(UISearchBar *)searchBar shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
{
    NSLog(@"%s", __PRETTY_FUNCTION__);
    return true;
}

- (BOOL)searchBarShouldBeginEditing:(UISearchBar *)searchBar
{
    NSLog(@"%s", __PRETTY_FUNCTION__);
    return true;
}

- (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar
{
    NSLog(@"%s", __PRETTY_FUNCTION__);
}

- (BOOL)searchBarShouldEndEditing:(UISearchBar *)searchBar
{
    NSLog(@"%s", __PRETTY_FUNCTION__);
    return true;
}

- (void)searchBarTextDidEndEditing:(UISearchBar *)searchBar
{
    NSLog(@"%s", __PRETTY_FUNCTION__);
}
回答1

NSNull 只是一个用于表示 null 的单例对象。 它传统上用于在无法处理 nil 条目的容器(数组和字典)中包装 nil 值。

在解析 json 并尝试将结果添加到集合中时,经常会出现此错误。

你在你的委托方法中做这样的事情吗?

编辑:根据您发送给该 NSNull (长度)的消息判断,您可能会得到一个“空”结果,因为您要求的字符串不希望为 nil。

回答2

在为此苦苦挣扎了一整天之后,它归结为一个完全不相关的问题:一个损坏的故事板。

这个 SO question 建议查找损坏的场景并重新创建它。 不幸的是,我无法确定这一点,因此经过反复试验,它最终成为我故事板中的初始视图控制器,恰好是UINavigationController 。 我删除了它,重新添加了它,一切都是金色的。

受限制的 HTML

  • 允许的HTML标签:<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • 自动断行和分段。
  • 网页和电子邮件地址自动转换为链接。

相关推荐
  • Typing in UISearchBar crashes my app
    UPDATE 2 My app is crashing when presenting it modally after a user taps a button in ViewController1. In my storyboard, I have a standard present modally segue set to pop up the UINavController/UITableViewController containing the UISearchBar. That's failing every time. However, in my AppDelegate, if I set the window's rootViewController to the same UINavController/UITableViewController, everything works as expected. For some reason transitioning via segue and then acting the UISearchBar is causing the crash. UPDATE 1 I'm now receiving the following error when tapping one letter: 2015-02-03 12
  • App crashes when user starts typing in UISearchBar
    I have a UISearchBar set up in a tableview with core data. When the user begins to type in the search bar the app crashes on the first letter. The error I get is (lldb). I'm not sure what I'm doing wrong. Any ideas? Thanks. Seems like my problem is with filteredQuotes = qs.filteredArrayUsingPredicate(predicate!) but not exactly sure what I'm doing wrong.(when I comment out this line the app doesn't crash - but search doesn't either work) // // KeepTableViewController.swift // Quotey // // Created by Mordechai Levi on 11/25/14. // Copyright (c) 2014 Martini. All rights reserved. // import UIKit
  • 当用户开始在 UISearchBar 中输入时应用程序崩溃(App crashes when user starts typing in UISearchBar)
    问题 我在带有核心数据的 tableview 中设置了一个 UISearchBar。 当用户开始在搜索栏中输入时,应用程序会在第一个字母处崩溃。 我得到的错误是(lldb) 。 我不确定我做错了什么。 有任何想法吗? 谢谢。 好像我的问题是filteredQuotes = qs.filteredArrayUsingPredicate(predicate!)但不确定我做错了什么。(当我注释掉这一行时,应用程序不会崩溃 - 但搜索也不起作用) // // KeepTableViewController.swift // Quotey // // Created by Mordechai Levi on 11/25/14. // Copyright (c) 2014 Martini. All rights reserved. // import UIKit import CoreData class KeepTableViewController: UITableViewController, UISearchBarDelegate{ @IBOutlet weak var searchBar: UISearchBar! var filteredQuotes = [AnyObject]() var keptQuotes = [NSManagedObject]() override func
  • TableView UISearchBar on Tab Bar Controller Crashes while Searching
    I've been playing around with a search facility for my application table view for a while now trying to get it working but i keep getting the same error in my console. Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: ' [NSCFDictionary rangeOfString:options:]: unrecognized selector sent to instance I believe that this following section may be the problem I have tried passing some NSLog entries inside the if statement and it seems to get through it but the problem is when I click on the search bar and starting typing, the first letter I type calls the error and
  • 自定义 UITableViewCell 导致 UISearchBar 崩溃(Custom UITableViewCell causing UISearchBar to crash)
    问题 我有一个设置了 UISearchBar 的 tableView。 每次用户开始在搜索栏中输入时,应用程序都会崩溃。 我发现问题在于我使用的是自定义 tableViewCell(当我尝试使用默认 tableViewCell 运行应用程序时,它没有崩溃并且工作正常。)。 有想法该怎么解决这个吗? 谢谢。 这是我的代码: import UIKit import CoreData class KeepTableViewController: UITableViewController, UISearchBarDelegate{ @IBOutlet weak var searchBar: UISearchBar! var filteredQuotes = [AnyObject]() var keptQuotes = [NSManagedObject]() override func viewDidLoad() { super.viewDidLoad() searchBar.delegate = self searchBar.showsScopeBar = true tableView.rowHeight = UITableViewAutomaticDimension getCoreData() searchDisplayController
  • Custom UITableViewCell causing UISearchBar to crash
    I have a tableView with a UISearchBar set up. Every time the user starts typing in the search bar the app crashes. I discovered that the problem is that I'm using a custom tableViewCell (when I tried running the app with the default tableViewCell it didn't crash and worked fine.). Any ideas on how to fix this? Thanks. Here's my code: import UIKit import CoreData class KeepTableViewController: UITableViewController, UISearchBarDelegate{ @IBOutlet weak var searchBar: UISearchBar! var filteredQuotes = [AnyObject]() var keptQuotes = [NSManagedObject]() override func viewDidLoad() { super
  • 标签栏控制器上的 TableView UISearchBar 在搜索时崩溃(TableView UISearchBar on Tab Bar Controller Crashes while Searching)
    问题 我一直在为我的应用程序表视图使用搜索工具一段时间,现在试图让它工作,但我一直在我的控制台中遇到相同的错误。 Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: ' [NSCFDictionary rangeOfString:options:]: unrecognized selector sent to instance 我相信以下部分可能是我尝试在 if 语句中传递一些 NSLog 条目的问题,它似乎通过它但问题是当我单击搜索栏并开始键入时,我键入的第一个字母调用错误并取消我的应用程序。 这就是问题所在 在视图中会出现“食物”数组初始化如下: NSString *myDBnew =@"/Users/taxsmart/Documents/rw3app.sql"; database = [[Sqlite alloc] init]; [database open:myDBnew]; NSString *quer = [NSString stringWithFormat:@"Select category from foodcat"]; Food = [database executeQuery:quer]; //[database executeNonQuery:quer]
  • UISearchBar 取消按钮颜色?(UISearchBar cancel button color?)
    问题
  • How to throttle search (based on typing speed) in iOS UISearchBar?
    I have a UISearchBar part of a UISearchDisplayController that is used to display search results from both local CoreData and remote API. What I want to achieve is the "delaying" of the search on the remote API. Currently, for each character typed by the user, a request is sent. But if the user types particularly fast, it does not make sense to send many requests: it would help to wait until he has stopped typing. Is there a way to achieve that? Reading the documentation suggests to wait until the users explicitly taps on search, but I don't find it ideal in my case. Performance issues. If
  • 如何在iOS UISearchBar中限制搜索(基于键入速度)?(How to throttle search (based on typing speed) in iOS UISearchBar?)
    问题 我有UISearchDisplayController的UISearchBar部分,该部分用于显示来自本地CoreData和远程API的搜索结果。 我要实现的是在远程API上进行搜索的“延迟”。 当前,对于用户键入的每个字符,都会发送一个请求。 但是,如果用户输入速度特别快,那么发送许多请求就没有意义:这将有助于等待用户停止输入。 有没有办法做到这一点? 阅读文档建议您等到用户明确点击搜索后,但就我而言,它并不理想。 性能问题。 如果可以非常快速地执行搜索操作,则可以通过在委托对象上实现searchBar:textDidChange:方法来更新用户输入时的搜索结果。 但是,如果搜索操作花费更多时间,则应等到用户点按“搜索”按钮,然后才能在searchBarSearchButtonClicked:方法中开始搜索。 始终在后台线程中执行搜索操作,以避免阻塞主线程。 这样可以在搜索运行时使您的应用对用户保持响应,并提供更好的用户体验。 向API发送许多请求不是本地性能的问题,而仅仅是避免远程服务器上的请求率过高。 谢谢 回答1 试试这个魔术: - (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText{ // to limit network activity, reload
  • UISearchBar 自定义代码在 iOS7 中崩溃,适用于 iOS6(UISearchBar customization code crashes in iOS7, works on iOS6)
    问题 我有一个 iOS 应用程序,支持 iOS5.1,我正在自定义搜索栏中的取消按钮。 我正在使用的代码在 iOS6.1 之前一直有效,如下所示: id barButtonAppearanceInSearchBar = [UIBarButtonItem appearanceWhenContainedIn: [UISearchBar class], nil]; [barButtonAppearanceInSearchBar setTitle: [self localizedStringValueFor:@"Cancel"]]; 不知何故,第二行会导致错误的访问异常,当我尝试设置按钮文本的值时, barButtonAppearanceInSearchBar似乎被释放。 localizedStringForValue是一个自定义方法,如果不存在翻译,它将返回带有所提供密钥或密钥本身的翻译的字符串。 现在,当我在 iOS7' 模拟器上运行该应用程序时,该应用程序总是崩溃。 一直试图弄清楚我做错了什么,但到目前为止没有运气。 回答1 setTitle不是一个支持 UIAppearanceContainer 的方法。 仅支持标有UI_APPEARANCE_SELECTOR属性。 创建UISearchBar时,您必须手动设置标题。
  • UITextField auto correction crash in iOS 4.3 on simulator
    The UITextField's auto correction crashes my app on the simulator with iOS 4.3 sdk build target. Works fine on the device and in the simulator with iOS 4.2 sdk. Anyone else experiencing this issue? I'm figuring its a bug with the 4.3 sdk? As soon as I type the second character. Stack Trace #0 0x01c01000 in objc_assign_ivar () #1 0x03b7ec34 in -[AppleSpell init] () #2 0x007e7538 in -[UITextChecker _checker] () #3 0x007e8de9 in -[UITextChecker checkSpellingOfString:startingAt:language:wrap:correction:] () #4 0x0b335725 in TIInputManagerZephyr::lookup_spellcheck_candidates(KB::String const&) ()
  • UISearchBar customization code crashes in iOS7, works on iOS6
    I have an iOS application, built to support iOS5.1, and I was customizing the cancel button inside search bars. The code I'm using and that works until iOS6.1 is the following: id barButtonAppearanceInSearchBar = [UIBarButtonItem appearanceWhenContainedIn: [UISearchBar class], nil]; [barButtonAppearanceInSearchBar setTitle: [self localizedStringValueFor:@"Cancel"]]; Somehow the second line will cause a bad access exception, the barButtonAppearanceInSearchBar seems to be deallocated when I try to set the value for the button's text. localizedStringForValue is a custom method that will return a
  • UIViewController 中的 UISearchBar 崩溃(UISearchBar in a UIViewController crashing)
    问题 我在使用 UISearchBar 时遇到了奇怪的崩溃。 我在情节提要上有一个视图控制器,一切正常,但是只要在视图控制器中拖动 UISearchBar 然后运行该应用程序,就会出现以下崩溃: * thread #1: tid = 0x6d83b, 0x0462169e libsystem_kernel.dylib`__pthread_kill + 10, queue = 'com.apple.main-thread', stop reason = signal SIGABRT frame #0: 0x0462169e libsystem_kernel.dylib`__pthread_kill + 10 frame #1: 0x045ef2c5 libsystem_pthread.dylib`pthread_kill + 101 frame #2: 0x043609c9 libsystem_sim_c.dylib`abort + 127 frame #4: 0x03a1c35d CoreFoundation`__handleUncaughtException + 749 frame #5: 0x0370bb8b libobjc.A.dylib`_objc_terminate() + 100 frame #6: 0x03ee5f60 libc++abi.dylib`std::_
  • UISearchBar in a UIViewController crashing
    I am having a weird crash when using UISearchBar. I have a view controller on a storyboard and everything works fine but as soon as a drag a UISearchBar in the view controller and then run the app, I get the following crash: * thread #1: tid = 0x6d83b, 0x0462169e libsystem_kernel.dylib`__pthread_kill + 10, queue = 'com.apple.main-thread', stop reason = signal SIGABRT frame #0: 0x0462169e libsystem_kernel.dylib`__pthread_kill + 10 frame #1: 0x045ef2c5 libsystem_pthread.dylib`pthread_kill + 101 frame #2: 0x043609c9 libsystem_sim_c.dylib`abort + 127 frame #4: 0x03a1c35d CoreFoundation`_
  • “ [NSBigMutableString substringWithRange:]:范围{0,10}超出范围; 撤消时字符串长度9”错误(“[NSBigMutableString substringWithRange:]: Range {0, 10} out of bounds; string length 9” error with Undo)
    问题 当我尝试在UISearchBar撤消操作时,我的应用程序崩溃了。 在我的应用程序中,我具有防止在搜索栏上输入'%'符号的代码,为此,它将textDidChange方法中的%替换为@“”,如下所示: - (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText { self.searchBar.text = [searchText stringByReplacingOccurrencesOfString:@"%" withString:@""]; } 因此,如果我输入文本“ abc%xyz”,则在搜索栏中可见的最终文本将是“ abcxyz”。 不,当我单击“撤消”时,我看到“ xyz”被清除了,我仍然在搜索栏上看到“ abc”,而不是一次全部清除“ abcxyz”。 现在,如果我再次单击撤消以清除'abc',则我的应用程序将崩溃,并显示[NSBigMutableString substringWithRange:]: Range out of bounds错误。 我假设即使将'%'替换为@“”,撤消管理器也可能仍将其保留,因此范围超出了范围。 我试过[searchBar.undoManager removeAllActions]; 在% textDidChange用@“”替换后
  • 当我开始搜索时,我在 UISearchController 中的 UISearchBar 消失了。 为什么?(My UISearchBar in UISearchController disappear when I start searching. Why?)
    问题 这就是我设置UIsearchController private func setupSearchController() { let searchResultsController = storyboard!.instantiateViewControllerWithIdentifier(DBSearchOptionControllerIdentifier) as! DBSearchOptionController searchController = UISearchController(searchResultsController: searchResultsController) let frame = searchController.searchBar.frame searchController.searchBar.frame = CGRectMake(0, 50, view.bounds.size.width, 44.0) searchController.searchResultsUpdater = self view.addSubview(searchController.searchBar) searchController.searchBar.text = "mmm" view.bringSubviewToFront(searchController
  • UISearchBar ios 7 crash on cancel
    I am using UITableViewController , in header view of table added search bar. Search and cancel button work fine for me in iOS 6 but in iOS 7 search working fine and when i tapped on cancel button app crash with below message . *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Auto Layout still required after executing -layoutSubviews. UITableView's implementation of -layoutSubviews needs to call super.' *** First throw call stack: ( 0 CoreFoundation 0x021f05e4 __exceptionPreprocess + 180 1 libobjc.A.dylib 0x01f738b6 objc_exception_throw + 44 2
  • 轻按取消按钮时,删除UISearchBar右侧的清除按钮(灰色x)(Remove clear button (grey x) to the right of UISearchBar when cancel button tapped)
    问题 正确,开始我的问题,以下是Spotify应用程序已解决的一些问题: Spotify的步骤1:标准UISearchBar不在编辑模式下。 Spotify的步骤2: UISearchBar现在处于编辑模式。 输入搜索词。 取消按钮从右侧滑入,然后出现清除按钮(灰色x)。 Spotify的步骤3:按下了“取消”按钮; 键盘滑出,搜索栏不再处于编辑模式。 搜索字词仍然保留,灰色的x按钮现已隐藏。 目前,按下我的“取消”按钮时,以下代码将触发: - (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar { [searchBar resignFirstResponder]; [searchBar setShowsCancelButton:NO animated:YES]; } 结果是: 我的第3步:搜索栏现在不处于编辑模式。 取消按钮和键盘已滑出。 搜索词仍然存在,灰色的x也是如此。 所以,我的问题是这样的:给定-resignFirstResponder (和-endEditing: ,FYI)在搜索栏中输入了文本后,它不会隐藏灰色的x按钮,那么如何隐藏它呢? 再次感谢朋友。 回答1 问题在于UISearchBar不会公开其文本字段,而是管理文本字段本身的属性。 有时,属性的值不是您想要的。 例如,在我自己的应用程序中
  • UISearchBar ios 7在取消时崩溃(UISearchBar ios 7 crash on cancel)
    问题