iOS Question MailComposer error

Discussion in 'iOS Questions' started by fishwolf, Jul 6, 2016.

Similar threads

B4i Tutorial Mails and SMS messages
B4i Question MailComposer From
B4i Question Cannot initialize MailComposer
B4i Question mail problem
B4i Question Send SMS without using MessageComposer
  1. fishwolf

    fishwolf Active Member Licensed User

    I'm using the MailComposer for send email for some apps

    Code:
    MailSend.Initialize("mailc")
    MailSend.SetToRecipients(
    Array("my@domain.com"))
    MailSend.SetSubject(
    "My Subject")
    MailSend.Show(PageName)
    from today work fine on ipad2, but doen't work on Iphone5-6, i have tried with emulator and from apple store.

    Code:
    rocess:  MailCompositionService [983]
    Path:  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/Applications/MailCompositionService.app/MailCompositionService
    Identifier:  MailCompositionService
    Version:  
    1.0 (1.0)
    Code 
    Type:  X86-64 (Native)
    Parent Process:  launchd_sim [
    826]
    Responsible:  MailCompositionService [
    983]
    User 
    ID:  504

    Date/Time:  
    2016-07-07 00:26:57.057 +0200
    OS Version:  
    Mac OS X 10.11.5 (15F34)
    Report Version:  
    11
    Anonymous UUID:  5733EF97-54FF-5E6D-654C-82B5CF8371AB


    Time Awake Since Boot: 
    2000 seconds

    System Integrity Protection: enabled

    Crashed 
    Thread:  0  Dispatch queue: com.apple.main-thread

    Exception Type:  EXC_CRASH (SIGABRT)
    Exception Codes:  0x00000000000000000x0000000000000000
    Exception Note:  EXC_CORPSE_NOTIFY

    Application Specific Information:
    *** Terminating app due 
    to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayI isEqualToString:]: unrecognized selector sent to instance 0x7fde80e1a5e0'
    terminating with uncaught exception of type NSException
    abort() called
    CoreSimulator 
    209.19 - Device: iPhone 6 - Runtime: iOS 9.3 (13E230) - DeviceType: iPhone 6

    Application Specific Backtrace 1:
    0  CoreFoundation  0x0000000105765d85 __exceptionPreprocess + 165
    1  libobjc.A.dylib  0x0000000105afbdeb objc_exception_throw + 48
    2  CoreFoundation  0x000000010576ed3d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
    3  CoreFoundation  0x00000001056b4cfa ___forwarding___ + 970
    4  CoreFoundation  0x00000001056b48a8 _CF_forwarding_prep_0 + 120
    5  MessageUI  0x000000010338aa08 -[MFMailComposeController _setSendingEmailAddress:addIfNotPresent:] + 112
    6  MessageUI  0x00000001033db397 +[MFComposeTypeFactory _setupForNewMessageWithModel:delegate:] + 82
    7  MessageUI  0x0000000103389330 -[MFMailComposeController _loadCompositionContext] + 425
    8  MailComposit
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Have you seen this error on a real device? Are you checking whether CanSendMail returns true?
     
  3. fishwolf

    fishwolf Active Member Licensed User

    yes, return false, i use gmail mail client

    return true only with email apple client

    is correct?
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    You can only send emails if it returns true. The default email client should be configured for this.
     
  5. wl

    wl Well-Known Member Licensed User

    Mailcomposer does not seem to work in an emulator: the email application starts but then your app crashes.
    Also CanSend is only TRUE when an account has been defined.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice