Причина исключения: -[NSParagraphStyle bytes]: нераспознанный селектор отправлен на экземпляр 0x16fe2130
У меня iOS, которая иногда дает сбой из-за "Причины исключения: -[NSParagraphStyle bytes]: нераспознанный селектор отправлен на экземпляр 0x16fe2130".
Журнал Crash выглядит так:
0 CoreFoundation 0x2b520477 <redacted> + 150
1 libobjc.A.dylib 0x3941bc8b objc_exception_throw + 38
2 CoreFoundation 0x2b525879 <redacted> + 0
3 CoreFoundation 0x2b523797 <redacted> + 714
4 CoreFoundation 0x2b455008 _CF_forwarding_prep_0 + 24
5 CoreGraphics 0x2b7814c3 CGGradientGetFunction + 42
6 CoreGraphics 0x2b7813ef CGContextDrawLinearGradient + 94
7 MPK aFON 0x0018622b MPK aFON + 573995
8 UIKit 0x2eab63f1 <redacted> + 400
9 QuartzCore 0x2e48f04d <redacted> + 228
10 QuartzCore 0x2e478a8b <redacted> + 2070
11 QuartzCore 0x2e55bc09 <redacted> + 52
12 QuartzCore 0x2e478269 <redacted> + 88
13 QuartzCore 0x2e477f19 <redacted> + 1160
14 QuartzCore 0x2e45c3d9 <redacted> + 200
15 QuartzCore 0x2e45c09d <redacted> + 24
16 QuartzCore 0x2e45ba71 <redacted> + 224
17 QuartzCore 0x2e45b875 <redacted> + 324
18 UIKit 0x2ea3c203 <redacted> + 1442
19 CoreFoundation 0x2b4e6fbf <redacted> + 14
20 CoreFoundation 0x2b4e63cf <redacted> + 218
21 CoreFoundation 0x2b4e4a35 <redacted> + 772
22 CoreFoundation 0x2b4323b1 CFRunLoopRunSpecific + 476
23 CoreFoundation 0x2b4321c3 CFRunLoopRunInMode + 106
24 GraphicsServices 0x32a19201 GSEventRunModal + 136
25 UIKit 0x2ea9c43d UIApplicationMain + 1440
26 MPK aFON 0x000fee3f MPK aFON + 20031
27 libdyld.dylib 0x399a7aaf <redacted> + 2
У меня есть файл dSYM для приложения и для "0x000fee3f", который я получил:
dSYM for Apps adrianmaftei$ dwarfdump --lookup 0x000fee3f app.app201.dSYM
----------------------------------------------------------------------
File: app.app201.dSYM/Contents/Resources/DWARF/App (armv7)
----------------------------------------------------------------------
Looking up address: 0x00000000000fee3f in .debug_info... found!
0x002033a1: Compile Unit: length = 0x000093d7 version = 0x0002 abbr_offset = 0x00000000 addr_size = 0x04 (next CU at 0x0020c77c)
0x002033ac: TAG_compile_unit [1] *
AT_producer( "Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)" )
AT_language( DW_LANG_ObjC )
AT_name( "/Users/adrianmaftei/Documents/Work/aFON/Classes/AfonLFManager.m" )
AT_stmt_list( 0x000611ac )
AT_comp_dir( "/Users/adrianmaftei/Documents/Work/aFON" )
AT_APPLE_optimized( 0x01 )
AT_APPLE_major_runtime_vers( 0x02 )
AT_low_pc( 0x000fec38 )
0x00204b37: TAG_subprogram [10] *
AT_name( "-[AfonLFManager parseColorInfo]" )
AT_decl_file( "/Users/adrianmaftei/Documents/Work/aFON/Classes/AfonLFManager.m" )
AT_decl_line( 57 )
AT_prototyped( 0x01 )
AT_APPLE_isa( 0x01 )
AT_accessibility( DW_ACCESS_public )
AT_low_pc( 0x000fed58 )
AT_high_pc( 0x000feee2 )
AT_frame_base( r7 )
AT_object_pointer( {0x00204b4f} )
0x00204b76: TAG_lexical_block [13] *
AT_ranges( 0x0000fa38
[0x000fed96 - 0x000feebc)
[0x000feec6 - 0x000feed2)
End )
0x00204b7b: TAG_lexical_block [13] *
AT_ranges( 0x0000fa50
[0x000fed9e - 0x000feebc)
[0x000feec6 - 0x000feed2)
End )
0x00204b8f: TAG_lexical_block [13] *
AT_ranges( 0x0000fa68
[0x000fedb0 - 0x000feebc)
[0x000feec6 - 0x000feed2)
End )
0x00204b94: TAG_lexical_block [13] *
AT_ranges( 0x0000fa80
[0x000fedb8 - 0x000feebc)
[0x000feec6 - 0x000feed2)
End )
0x00204b99: TAG_lexical_block [13] *
AT_ranges( 0x0000fa98
[0x000fedb8 - 0x000feebc)
[0x000feec6 - 0x000feed2)
End )
0x00204ba9: TAG_lexical_block [13] *
AT_ranges( 0x0000fab0
[0x000fedb8 - 0x000feebc)
[0x000feec6 - 0x000feeca)
End )
Line table dir : '/Users/adrianmaftei/Documents/Work/aFON/Classes'
Line table file: 'AfonLFManager.m' line 64, column 0 with start address 0x00000000000fee10
Looking up address: 0x00000000000fee3f in .debug_frame... found!
0x0000d8f0: FDE
length: 0x0000000c
CIE_pointer: 0x00000000
start_addr: 0x000fed58 -[AfonLFManager parseColorInfo]
range_size: 0x0000018a (end_addr = 0x000feee2)
Instructions: 0x000fed58: CFA=4294967295+4294967295
У вас есть идеи о том, как я могу решить проблему?
Обновление: код для parseColorInfo:
-(void)parseColorInfo{
TBXML *tbxml = [TBXML tbxmlWithXMLString:xmlContent];
if (tbxml){
TBXMLElement *root = tbxml.rootXMLElement;
if (root){
for (int i=0; i<8; i++){
TBXMLElement *dp = [TBXML childElementNamed:[NSString stringWithFormat:@"color%d", i+1] parentElement:root];
if (dp) {
if( i < [colors count] ) {
UIColor *color = [colors objectAtIndex:i];
if( [TBXML textForElement:dp] ) {
color = [self colorFromHexString:[TBXML textForElement:dp]];
if( color )
[colors setObject:color atIndexedSubscript:i];
}
}
}
}
}
}
}
- (UIColor *)colorFromHexString:(NSString *)hexString {
unsigned rgbValue = 0;
NSScanner *scanner = [NSScanner scannerWithString:hexString];
if( scanner ) {
[scanner setScanLocation:1]; // bypass '#' character
[scanner scanHexInt:&rgbValue];
return [UIColor colorWithRed:((rgbValue & 0xFF0000) >> 16)/255.0 green:((rgbValue & 0xFF00) >> 8)/255.0 blue:(rgbValue & 0xFF)/255.0 alpha:1.0];
}
return nil;
}