Tôi hiện đang gặp sự cố với iOS7 và MFMailComposeViewController
. Đôi khi (khá thường xuyên nhưng không phải luôn luôn), tôi có sự sụp đổ sau khi trình bày các MFMailComposeViewController
:Soạn thư trong iOS 7: Lỗi xác nhận trong - [Bố cục MFComposeSubjectViewSublayersOfLayer:]
** * Assertion thất bại trong - [MFComposeSubjectView layoutSublayersOfLayer:], /SourceCache/UIKit/UIKit-2903.23/UIView.m : 8540
Sau đây là cách tôi trình bày điều khiển:
if ([MFMailComposeViewController canSendMail])
{
MFMailComposeViewController* mailVC = [[MFMailComposeViewController alloc] initWithNibName:nil bundle:nil];
mailVC.mailComposeDelegate = self;
[mailVC setSubject:@"blablabla"]];
[mailVC setMessageBody:@"blablabla" isHTML:NO];
mailVC.modalPresentationStyle = UIModalPresentationFormSheet;
mailVC.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
if(isIpad) {
[sharedParentViewController presentViewController:mailVC animated:YES completion:nil];
} else {
[sharedNavigationViewController presentViewController:mailVC animated:YES completion:nil];
}
}
sharedParentViewController
và sharedNavigationViewController
được định nghĩa macro để truy cập xem gốc điều khiển ở khắp mọi nơi trong ứng dụng.
Tôi thiết lập điểm ngắt trên tất cả ngoại lệ nhưng rất tiếc, nó không bao giờ bị hỏng.
Với iOS6 và iOS5, mọi thứ hoạt động tốt, bất kỳ ý tưởng nào về những gì tôi có thể cố gắng khắc phục sự cố này?
EDIT:
Đây là nhật ký sự cố:
Stack Trace
Auto Layout still required after executing -layoutSubviews. MFComposeSubjectView's implementation of -layoutSubviews needs to call super.
0 CoreFoundation 0x3099ff4b <redacted> + 130
1 libobjc.A.dylib 0x3b1366af objc_exception_throw + 38
2 CoreFoundation 0x3099fe25 <redacted> + 0
3 Foundation 0x31347fe3 <redacted> + 90
4 UIKit 0x33112e63 <redacted> + 538
5 QuartzCore 0x32d99c6b <redacted> + 142
6 QuartzCore 0x32d9547b <redacted> + 350
7 QuartzCore 0x32d9530d <redacted> + 16
8 QuartzCore 0x32d94d1f <redacted> + 230
9 QuartzCore 0x32d94b2f <redacted> + 314
10 QuartzCore 0x32d8e85d <redacted> + 56
11 CoreFoundation 0x3096b1cd <redacted> + 20
12 CoreFoundation 0x30968b71 <redacted> + 284
13 CoreFoundation 0x30968eb3 <redacted> + 730
14 CoreFoundation 0x308d3c27 CFRunLoopRunSpecific + 522
15 CoreFoundation 0x308d3a0b CFRunLoopRunInMode + 106
16 GraphicsServices 0x355c7283 GSEventRunModal + 138
17 UIKit 0x33177049 UIApplicationMain + 1136
18 teleobs 0x00037921 main + 116
19 teleobs 0x000378a8 start + 40
đang u sử dụng bộ chọn xuất hiện để thiết lập màu sắc thanh điều hướng? nếu bạn làm như vậy, hãy thử không sử dụng hình ảnh để tạo ra màu sắc! –
@ChamiraFernando Không, tôi đã kiểm tra ngay bây giờ, bộ chọn UIAppearance không được sử dụng ở tất cả. – Gl0ub1l
hoặc u thay đổi màu điều khiển bằng cách sử dụng hình ảnh? ý tôi là [uicolor colorWithPatternImage]? –