大家好,我爲我的應用程序部署了一個更新,很少有用戶抱怨/評論不好的應用程序關閉它們。EXC_CRASH(SIGBART)崩潰報告
一位用戶向我發送了一個崩潰報告,並且我已經重新對其進行了符號化,並且顯示了崩潰的方法和行號。
我已經嘗試了很多可能的解決方案,但對於我的生活我無法在我的設備上重現它。
任何人都可以請善待,讓我知道這可能是在下面的代碼編譯崩潰的應用程序的問題:
線沒有導致崩潰爲m:555,即
NSAttributedString *attributedText = [[NSAttributedString alloc] initWithString:text attributes:@{NSFontAttributeName: font}];
我不確定這個問題是什麼,我試圖通過@「」空作爲內容仍然不崩潰。
-(CGFloat)getCellHeightForContent:(NSString*)content
{
NSString *text = content;
CGFloat width = self.tableview.frame.size.width - 15 - 30 - 15; //tableView width - left border width - accessory indicator - right border width
UIFont *font = [UIFont systemFontOfSize:17];
NSAttributedString *attributedText = [[NSAttributedString alloc] initWithString:text attributes:@{NSFontAttributeName: font}];
CGRect rect = [attributedText boundingRectWithSize:(CGSize){width, CGFLOAT_MAX}
options:NSStringDrawingUsesLineFragmentOrigin
context:nil];
CGSize size = rect.size;
size.height = ceilf(size.height);
size.width = ceilf(size.width);
if ((size.height)+ 5 < 70) {
return 70;
}
return size.height + 15;
}
這裏是崩潰報告
Incident Identifier: CAB2B27B-F65F-4F8A-82C6-C1AECD791335
CrashReporter Key: 759ffd08fa781ee7b8ae9515835758c563110d7f
Hardware Model: iPhone5,1
Process: xxxx [9226]
Path: /var/mobile/Applications/AA5E7A52-ED1E-421F-B377-CF32D55E71EA/xxxx.app/xxxx
Identifier: com.xxxx.xxxx
Version: 7.0.1 (7.0.1)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2014-06-18 22:09:44.336 -0400
OS Version: iOS 7.1.1 (11D201)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 0
Last Exception Backtrace:
0 CoreFoundation 0x2e33bf06 0x2e267000 + 872198
1 libobjc.A.dylib 0x38ad2ce2 0x38acf000 + 15586
2 CoreFoundation 0x2e33be48 0x2e267000 + 872008
3 Foundation 0x2ec72bd0 0x2ec57000 + 113616
4 Foundation 0x2ec72aac 0x2ec57000 + 113324
5 xxxx 0x00073850 -[DetailVC getCellHeightForContent:] (DetailVC.m:555)
6 xxxx 0x000725b4 -[DetailVC tableView:heightForRowAtIndexPath:] (DetailVC.m:382)
7 UIKit 0x30c7b1ae 0x30b60000 + 1159598
8 UIKit 0x30c3fd92 0x30b60000 + 916882
9 UIKit 0x30c41b6c 0x30b60000 + 924524
10 UIKit 0x30c41ac0 0x30b60000 + 924352
11 UIKit 0x30c416ba 0x30b60000 + 923322
12 xxxx 0x00070c4c -[DetailVC viewDidLoad] (DetailVC.m:157)
13 UIKit 0x30b6fa4e 0x30b60000 + 64078
14 UIKit 0x30b6f80c 0x30b60000 + 63500
15 UIKit 0x30cfbc0e 0x30b60000 + 1686542
16 UIKit 0x30c1948a 0x30b60000 + 758922
......
預先感謝您的幫助!
崩潰報告在哪裏? – Kerni
與你的問題無關,但我真的不喜歡那些瘋狂的神奇數字。你應該將它們定義爲常量。 –
@LordZsolt ..謝謝你,我會的。 – snowflakes74