gpt4 book ai didi

ios - 自 ios7.1 以来的随机崩溃与 NSString(NSExtendedStringDrawing) drawWithRect :options:attributes:context

转载 作者:行者123 更新时间:2023-12-01 16:42:14 24 4
gpt4 key购买 nike

我的一些用户在 ios7.1 上升级他们的设备后,在他们按下应用程序中的“搜索按钮”后报告了系统性崩溃。
不幸的是,我无法在我自己的运行 ios7.1 或 7.1.1 的设备上重现此错误

这是代码:

- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar {
[searchBar resignFirstResponder];

if (searchBar.text.length > 0)
{
[self loadingStartAnimating];
[NSThread detachNewThreadSelector:@selector(updateSearchTable:) toTarget:self withObject:nil];
}
}



-(void)updateSearchTable:(id)data
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[searchViewController updateWithString:[self cleanString:theSearchBar.text]];
[pool release];
}

在 searchViewController 中,它是用包含 Table View 的 xib 构建的:
-(void)updateWithString:(NSString*)searchText
{
[self.searchWikiList removeAllObjects];

SQLManager *sq = [[SQLManager alloc] initDatabase];
self.searchWikiList = [sq allocWikisFromDatabase:searchText mode:2];
[sq release];

[self.iPadSearchTableView reloadData];
[self.iPadSearchTableView setContentOffset:CGPointMake(0, 0) animated:NO];
[self.view setHidden:NO];
[self.iPadViewController loadingStopAnimating];

}

一位用户发送了以下我已符号化的崩溃日志。有人可以帮我弄清楚发生了什么吗?

我不明白这是一个“doesNotRecognizeSelector”异常,但在“OS”代码中(当然我自己没有写)。也许在 xib 文件的某个地方有错误?
Thread 14 Crashed:
0 libsystem_c.dylib 0x3b75206b __abort + 103
1 libsystem_c.dylib 0x3b752001 abort + 85
2 libc++abi.dylib 0x3aba098b abort_message + 71
3 libc++abi.dylib 0x3abb96e3 default_terminate_handler() + 251
4 libobjc.A.dylib 0x3b1ecf7b _objc_terminate() + 191
5 libc++abi.dylib 0x3abb71b1 std::__terminate(void (*)()) + 77
6 libc++abi.dylib 0x3abb6a05 __cxa_throw + 113
7 libobjc.A.dylib 0x3b1ecdb7 objc_exception_throw + 247
8 CoreFoundation 0x3061c833 -[NSObject(NSObject) doesNotRecognizeSelector:] + 199
9 CoreFoundation 0x3061b12b ___forwarding___ + 703
10 CoreFoundation 0x3056a0d4 __forwarding_prep_0___ + 20
11 UIFoundation 0x384fe911 __NSStringDrawingEngine + 12249
12 UIFoundation 0x384fb85f -[NSString(NSExtendedStringDrawing) drawWithRect:options:attributes:context:] + 147
13 UIKit 0x32e612c5 -[UILabel _drawTextInRect:baselineCalculationOnly:] + 4221
14 UIKit 0x32ec7705 -[UILabel drawTextInRect:] + 497
15 UIKit 0x32ec7507 -[UILabel drawRect:] + 75
16 UIKit 0x32ec74a5 -[UIView(CALayerDelegate) drawLayer:inContext:] + 369
17 QuartzCore 0x32af3185 -[CALayer drawInContext:] + 97
18 QuartzCore 0x32adcc59 CABackingStoreUpdate_ + 1857
19 QuartzCore 0x32bb8c19 ___ZN2CA5Layer8display_Ev_block_invoke + 49
20 QuartzCore 0x32adc509 x_blame_allocations + 81
21 QuartzCore 0x32adc1bb CA::Layer::display_() + 1115
22 QuartzCore 0x32abfd3d CA::Layer::display_if_needed(CA::Transaction*) + 205
23 QuartzCore 0x32abf9d5 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 21
24 QuartzCore 0x32abf3e1 CA::Context::commit_transaction(CA::Transaction*) + 225
25 QuartzCore 0x32abf1f3 CA::Transaction::commit() + 311
26 QuartzCore 0x32aec8df CA::Transaction::release_thread(void*) + 159
27 libsystem_pthread.dylib 0x3b8076cf _pthread_tsd_cleanup + 163
28 libsystem_pthread.dylib 0x3b80744f _pthread_exit + 83
29 libsystem_pthread.dylib 0x3b8081b5 pthread_exit + 25
30 Foundation 0x30f556ff +[NSThread exit] + 7
31 Foundation 0x31001a29 __NSThread__main__ + 1089
32 libsystem_pthread.dylib 0x3b808957 _pthread_body + 139
33 libsystem_pthread.dylib 0x3b8088c7 _pthread_start + 99
34 libsystem_pthread.dylib 0x3b806ae4 thread_start + 4

最佳答案

它也发生在带有 iOS 7.1/7.11 的生产设备上,主要是在 iPhone 4/4S 上(但不仅仅是)。

异常原因始终为 -[_UIFontCacheKey set]: unrecognized selector sent to instance 0x1551b0a0 ,请参阅下面的调用堆栈。

当它发生时,它总是在同一个地方——当应用程序使用后台线程重绘 View 时。因此,正如@iOS Dev 指出的那样,也许它确实与此有关。

#0  CoreFoundation                      0030449F0B <redacted>()
#1 libobjc.A.dylib 003ABE0CE7 objc_exception_throw()
#2 CoreFoundation 003044D837 -[NSObject doesNotRecognizeSelector:]
#3 CoreFoundation 003044C137 <redacted>()
#4 CoreFoundation 003039B098 _CF_forwarding_prep_0()
#5 UIFoundation 00380C83FD <redacted>()
#6 UIFoundation 00380C6863 -[NSString drawWithRect:options:attributes:context:]
#7 UIKit 0032C922C9 -[UILabel _drawTextInRect:baselineCalculationOnly:]
#8 UIKit 0032CF8709 -[UILabel drawTextInRect:]
#9 UIKit 0032CF850B -[UILabel drawRect:]
#10 UIKit 0032CF84A9 -[UIView drawLayer:inContext:]
#11 QuartzCore 0032924189 -[CALayer drawInContext:]
#12 QuartzCore 003290DC5B <redacted>()
#13 QuartzCore 00329E9C1D <redacted>()
#14 QuartzCore 003290D50B <redacted>()
#15 QuartzCore 003290D1BF <redacted>()
#16 QuartzCore 00328F0D41 <redacted>()
#17 QuartzCore 00328F09D9 <redacted>()
#18 QuartzCore 00328F03E5 <redacted>()
#19 QuartzCore 00328F01F7 <redacted>()
#20 QuartzCore 00328E9F1D <redacted>()
#21 CoreFoundation 0030415039 <redacted>()
#22 CoreFoundation 00304129C7 <redacted>()
#23 CoreFoundation 0030412D13 <redacted>()
#24 CoreFoundation 003037D769 CFRunLoopRunSpecific()
#25 CoreFoundation 003037D54B CFRunLoopRunInMode()
#26 GraphicsServices 00352EA6D3 GSEventRunModal()
#27 UIKit 0032CDC891 UIApplicationMain()
#28 myApp 00000633AB main()
#29 libdyld.dylib 003B0DEAB7 <redacted>()

关于ios - 自 ios7.1 以来的随机崩溃与 NSString(NSExtendedStringDrawing) drawWithRect :options:attributes:context,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23286179/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com