- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在使用 UISearchBar 时发生了奇怪的崩溃。我在 Storyboard上有一个 View Controller ,一切正常,但是一旦在 View Controller 中拖动 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::__terminate(void (*)()) + 14
frame #7: 0x03ee597d libc++abi.dylib`__cxa_throw + 116
frame #8: 0x0370b9fc libobjc.A.dylib`objc_exception_throw + 323
frame #9: 0x03a29243 CoreFoundation`-[NSObject(NSObject) doesNotRecognizeSelector:] + 275
frame #10: 0x0397c50b CoreFoundation`___forwarding___ + 1019
frame #11: 0x0397c0ee CoreFoundation`__forwarding_prep_0___ + 14
frame #12: 0x01fd0ba4 UIKit`-[UISearchBar(UISearchBarStatic) _updateMagnifyingGlassView] + 486
frame #13: 0x01fd0cdb UIKit`-[UISearchBar(UISearchBarStatic) _setupSearchField] + 210
frame #14: 0x01fc6af6 UIKit`-[UISearchBar initWithCoder:] + 1500
frame #15: 0x0210bd6d UIKit`UINibDecoderDecodeObjectForValue + 704
frame #16: 0x0210bf6e UIKit`UINibDecoderDecodeObjectForValue + 1217
frame #17: 0x0210baa1 UIKit`-[UINibDecoder decodeObjectForKey:] + 114
frame #18: 0x01d43fa4 UIKit`-[UIView initWithCoder:] + 842
frame #19: 0x0210bd6d UIKit`UINibDecoderDecodeObjectForValue + 704
frame #20: 0x0210baa1 UIKit`-[UINibDecoder decodeObjectForKey:] + 114
frame #21: 0x01fa67a7 UIKit`-[UIRuntimeConnection initWithCoder:] + 191
frame #22: 0x0210bd6d UIKit`UINibDecoderDecodeObjectForValue + 704
frame #23: 0x0210bf6e UIKit`UINibDecoderDecodeObjectForValue + 1217
frame #24: 0x0210baa1 UIKit`-[UINibDecoder decodeObjectForKey:] + 114
frame #25: 0x01fa5c21 UIKit`-[UINib instantiateWithOwner:options:] + 1117
frame #26: 0x01e0e6f5 UIKit`-[UIViewController _loadViewFromNibNamed:bundle:] + 280
frame #27: 0x01e0ee9d UIKit`-[UIViewController loadView] + 302
frame #28: 0x01e0f0d3 UIKit`-[UIViewController loadViewIfRequired] + 78
frame #29: 0x01e0f5d9 UIKit`-[UIViewController view] + 35
frame #30: 0x01e29942 UIKit`-[UINavigationController _startCustomTransition:] + 778
frame #31: 0x01e368f7 UIKit`-[UINavigationController _startDeferredTransitionIfNeeded:] + 688
frame #32: 0x01e374e9 UIKit`-[UINavigationController __viewWillLayoutSubviews] + 57
frame #33: 0x01f780d1 UIKit`-[UILayoutContainerView layoutSubviews] + 213
frame #34: 0x01d5f964 UIKit`-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
frame #35: 0x0371d82b libobjc.A.dylib`-[NSObject performSelector:withObject:] + 70
frame #36: 0x0068345a QuartzCore`-[CALayer layoutSublayers] + 148
frame #37: 0x00677244 QuartzCore`CA::Layer::layout_if_needed(CA::Transaction*) + 380
frame #38: 0x006770b0 QuartzCore`CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 26
frame #39: 0x005dd7fa QuartzCore`CA::Context::commit_transaction(CA::Transaction*) + 294
frame #40: 0x005deb85 QuartzCore`CA::Transaction::commit() + 393
frame #41: 0x005df258 QuartzCore`CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 92
frame #42: 0x0395436e CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
frame #43: 0x039542bf CoreFoundation`__CFRunLoopDoObservers + 399
frame #44: 0x03932254 CoreFoundation`__CFRunLoopRun + 1076
frame #45: 0x039319d3 CoreFoundation`CFRunLoopRunSpecific + 467
frame #46: 0x039317eb CoreFoundation`CFRunLoopRunInMode + 123
frame #47: 0x048dd5ee GraphicsServices`GSEventRunModal + 192
frame #48: 0x048dd42b GraphicsServices`GSEventRun + 104
frame #49: 0x01cf0f9b UIKit`UIApplicationMain + 1225
* frame #50: 0x00008f2d `main(argc=1, argv=0xbfffed90) + 141 at main.m:16
我不知道这里发生了什么。我所做的只是在 Storyboard中的主视图和 View Controller 中拖动一个 UISearchBar。没有搜索栏,一切正常,但是当我添加搜索栏并运行应用程序时。当我到达 View Controller 时,我遇到了这个崩溃。奇怪的是,控件甚至没有转到 View Controller 的 viewDidLoad
。以前有其他人遇到过这个问题吗?我该怎么办?
正确的崩溃轨迹:
2014-08-09 10:07:39.518 MyWorkflowww[20945:607] -[UIView setImage:]: unrecognized selector sent to instance 0xcf04830
2014-08-09 10:07:39.522 MyWorkflowww[20945:607] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView setImage:]: unrecognized selector sent to instance 0xcf04830'
*** First throw call stack:
(
0 CoreFoundation 0x039891e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x037088e5 objc_exception_throw + 44
2 CoreFoundation 0x03a26243 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x0397950b ___forwarding___ + 1019
4 CoreFoundation 0x039790ee _CF_forwarding_prep_0 + 14
5 UIKit 0x01fcdba4 -[UISearchBar(UISearchBarStatic) _updateMagnifyingGlassView] + 486
6 UIKit 0x01fcdcdb -[UISearchBar(UISearchBarStatic) _setupSearchField] + 210
7 UIKit 0x01fc3af6 -[UISearchBar initWithCoder:] + 1500
8 UIKit 0x02108d6d UINibDecoderDecodeObjectForValue + 704
9 UIKit 0x02108f6e UINibDecoderDecodeObjectForValue + 1217
10 UIKit 0x02108aa1 -[UINibDecoder decodeObjectForKey:] + 114
11 UIKit 0x01d40fa4 -[UIView initWithCoder:] + 842
12 UIKit 0x02108d6d UINibDecoderDecodeObjectForValue + 704
13 UIKit 0x02108aa1 -[UINibDecoder decodeObjectForKey:] + 114
14 UIKit 0x01fa37a7 -[UIRuntimeConnection initWithCoder:] + 191
15 UIKit 0x02108d6d UINibDecoderDecodeObjectForValue + 704
16 UIKit 0x02108f6e UINibDecoderDecodeObjectForValue + 1217
17 UIKit 0x02108aa1 -[UINibDecoder decodeObjectForKey:] + 114
18 UIKit 0x01fa2c21 -[UINib instantiateWithOwner:options:] + 1117
19 UIKit 0x01e0b6f5 -[UIViewController _loadViewFromNibNamed:bundle:] + 280
20 UIKit 0x01e0be9d -[UIViewController loadView] + 302
21 UIKit 0x01e0c0d3 -[UIViewController loadViewIfRequired] + 78
22 UIKit 0x01e0c5d9 -[UIViewController view] + 35
23 UIKit 0x01d2c267 -[UIWindow addRootViewControllerViewIfPossible] + 66
24 UIKit 0x01d2c5ef -[UIWindow _setHidden:forced:] + 312
25 UIKit 0x01d2c86b -[UIWindow _orderFrontWithoutMakingKey] + 49
26 UIKit 0x01d373c8 -[UIWindow makeKeyAndVisible] + 65
27 MyWorkflowww 0x000091c2 -[MyAppDelegate application:didFinishLaunchingWithOptions:] + 610
28 UIKit 0x01ce714f -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 309
29 UIKit 0x01ce7aa1 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1810
30 UIKit 0x01cec667 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 824
31 UIKit 0x01d00f92 -[UIApplication handleEvent:withNewEvent:] + 3517
32 UIKit 0x01d01555 -[UIApplication sendEvent:] + 85
33 UIKit 0x01cee250 _UIApplicationHandleEvent + 683
34 GraphicsServices 0x048dbf02 _PurpleEventCallback + 776
35 GraphicsServices 0x048dba0d PurpleEventCallback + 46
36 CoreFoundation 0x03904ca5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
37 CoreFoundation 0x039049db __CFRunLoopDoSource1 + 523
38 CoreFoundation 0x0392f68c __CFRunLoopRun + 2156
39 CoreFoundation 0x0392e9d3 CFRunLoopRunSpecific + 467
40 CoreFoundation 0x0392e7eb CFRunLoopRunInMode + 123
41 UIKit 0x01cebd9c -[UIApplication _run] + 840
42 UIKit 0x01cedf9b UIApplicationMain + 1225
43 0x00008f2d main + 141
44 libdyld.dylib 0x044f36d9 start + 1
45 ??? 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
最佳答案
发现问题,显然我使用的是将 leftView 设置为 UIView 的外观方法。当 UISearchBar 中的 UITextField 将放大镜图像设置为 UITextField 的左 View (这是一个 UIView)时,这就是它崩溃的原因。修复它。
关于ios - UIViewController 中的 UISearchBar 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25214509/
我有一段代码看起来像这样: void update_clock(uint8_t *time_array) { time_t time = *((time_t *) &time_array[0]
应用程序崩溃了 :( 请帮助我.. 在这方面失败了。我找不到错误?该应用程序可以连接到 iTunesConnect 但它会出错。 谁能根据下面的崩溃报告判断问题出在哪里? share_with_app
小二是新来的实习生,作为技术 leader,我给他安排了一个非常简单的练手任务,把前端 markdown 编辑器里上传的图片保存到服务器端,结果他真的就把图片直接保存到了服务器上,这下可把我气坏了,就
我正在创建一个函数,它将目录路径作为参数传递,或者如果它留空,则提示用户输入。 我已经设置了我的 PATH_MAX=100 和 if 语句来检查 if ((strlen(folder path) +
我已将“arial.ttf”文件(从我的/Windows/Fonts 文件夹中获取)加载到内存中,但是将其传递到 FT_New_Memory_Face 时会崩溃(在 FT_Open_Face 中的某处
我正在尝试在我的计算机上的两个控制台之间进行 rtsp 流。 在控制台 1 上,我有: ffmpeg -rtbufsize 100M -re -f dshow -s 320x240 -i video=
我正在尝试使用 scio_beast在一个项目中。我知道它还没有完成,但这并不重要。我已经设法让它工作得很好。 我现在正在尝试连接到 CloudFlare 后面的服务器,我知道我需要 SNI 才能工作
我有一个带有关联宏的下拉列表,如下所示: Sub Drop() If Range("Hidden1!A1") = "1" Then Sheets("Sheet1").Se
我对 bash 很陌生。我要做的就是运行这个nvvp -vm /usr/lib64/jvm/jre-1.8.0/bin/java无需记住最后的路径。我认为 instafix 就是这样做...... n
我在 Windows 上使用 XAMPP 已经两年左右了,它运行完美,没有崩溃没有问题。 (直到四个月前。) 大约四个月前,我们将服务器/系统升级到了更快的规范。 这是旧规范的内容 - Windows
我面临着一个非常烦人的 android 崩溃,它发生在大约 1% 的 PRODUCTION session 中,应用程序始终在后台运行。 Fatal Exception: android.app.Re
尝试使用下面的函数: public void createObjectType() { try { mCloudDB.createObjectType(ObjectTypeIn
由于我正在进行的一个项目,我在 CF11 管理员中弄乱了类路径,我设法使服务器崩溃,以至于我唯一得到的是一个漂亮的蓝屏和 500 错误.我已经检查了日志,我会把我能做的贴在帖子的底部,但我希望有人会启
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 10 个月前关闭。 Improve
我最近从 xcode 3.x 更新到 4.2,当我在 4.2 中运行应用程序时,我遇到了核心数据问题。我还更新到了 iOS 5,所以问题可能就在那里,我不太确定。 这些应用程序在 3.x 中运行良好,
我是一个相对较新的 iPhone 应用程序开发人员,所以我的知识有点粗略,所以如果这是一个微不足道的问题,请原谅我。 我有一个导航应用程序,它通过在navigationController对象上调用p
if ([MFMailComposeViewController canSendMail]) { MFMailComposeViewController *mailViewController
你能帮我吗? 我正在设置 UILocalNotification,当我尝试设置其 userInfo 字典时,它崩溃了。 fetchedObjects 包含 88 个对象。 这是代码: NSDi
为什么我的代码中突然出现 NSFastEnumeration Mutation Handler 崩溃。我很茫然为什么会突然出现这个崩溃以及如何解决它。 最佳答案 崩溃错误: **** 由于未捕获的异常
当我从表中删除行时,我的应用程序崩溃了。这是我检测到错误和堆栈跟踪的来源。谢谢! //delete row from database - (void)tableView:(UITableView *
我是一名优秀的程序员,十分优秀!