2014-05-25 6 views
0

메일 양식을 제공하기 위해 아래 코드를 실행하면 충돌이 발생합니다. 이 시점에서 아이디어가 부족합니다. 누군가?MFMailComposeViewController 충돌이 발생했습니다.

코드 :

Class mailClass = (NSClassFromString(@"MFMailComposeViewController")); 

if (mailClass != nil && [mailClass canSendMail]) 
{ 
    MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init]; 
    picker.mailComposeDelegate = self; 

    [picker setSubject:@"Subject"]; 

    [self presentViewController:picker animated:YES completion:nil]; 
} 

그러나

-[UIDeviceRGBColor shadowOffset]: unrecognized selector sent to instance 0xc135710 


0 CoreFoundation      0x02c2f1e4 __exceptionPreprocess + 180 
1 libobjc.A.dylib      0x028f98e5 objc_exception_throw + 44 
2 CoreFoundation      0x02ccc243 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275 
3 CoreFoundation      0x02c1f50b ___forwarding___ + 1019 
4 CoreFoundation      0x02c1f0ee _CF_forwarding_prep_0 + 14 
5 UIKit        0x014763fe -[UINavigationItemView _currentTextShadowOffsetForBarStyle:] + 132 
6 UIKit        0x014766b2 -[UINavigationItemView _updateLabelContents] + 396 
7 UIKit        0x01476ef1 -[UINavigationItemView _titleSize] + 51 
8 UIKit        0x01476806 -[UINavigationItemView _labelFrame] + 80 
9 UIKit        0x01475f60 -[UINavigationItemView initWithNavigationItem:] + 416 
10 UIKit        0x0144ad5a -[UINavigationItem _defaultTitleView] + 116 
11 UIKit        0x01447808 -[UINavigationItem _addDefaultTitleViewToNavigationBarIfNecessary] + 50 
12 UIKit        0x01447eb2 -[UINavigationItem setTitle:] + 212 
13 MessageUI       0x0073ac96 -[MFMailComposeInternalViewController viewDidLoad] + 593 
14 UIKit        0x014cb33d -[UIViewController loadViewIfRequired] + 696 

노트 충돌 : 내 클래스는 MFMailComposeViewControllerDelegate 내가 필요한 메소드를 구현 않습니다.

- (void)mailComposeController:(MFMailComposeViewController*)controller 
      didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error 

답변

0

내 실수. 모양 프록시를 사용하지만 맨 위 탐색 모음이없는 경우가 원인입니다.

[UINavigationBar 모양] 을 설정했지만 프로젝트가 진행되는 동안 마음이 바뀌고 기본 탐색없이 UI가 사용되었습니다.

관련 문제