Skip navigation

MFMessageComposeViewController

1042 Views 1 Reply Latest reply: Oct 12, 2012 9:34 AM by rebel399 RSS
Friendlyman Calculating status...
Currently Being Moderated
Oct 2, 2012 3:39 AM

im trying to build an application that can sending sms and im using ios 6 and xcode 4.5

 

the code is not working fine in ios and give me this error

 

2012-10-02 13:13:30.688 AutoSms[1436:907] Warning: Attempt to present <MFMessageComposeViewController: 0x1c598fa0> on <SecondViewController: 0x1c5755b0> whose view is not in the window hierarchy!

 

 

anybody can help me?!!

iPhone 5, iOS 6
  • rebel399 Calculating status...
    Currently Being Moderated
    Oct 12, 2012 9:34 AM (in response to Friendlyman)

    Hi Friendlyman, I ran into the same problem.   MFMessage.. code that worked under Xcode 4.1 & 4.2 using iOS4.3 & iOS5.1 starting issuing the warning message using iPhone 4 with xcode 4.5/iOS6.  The result was the MFMessageComposeViewController, which presents the SMS screen doesn't load.  The good news is that it really is a warning message.

     

    Basically, here's what's happening - your cancelling the SMS screen <MFMessageComposeViewController> before it gets a chance to load.   In early versions of iOS, you could present your screen <SecondViewController>, call the MFMessageComposeViewController, and queue an exit/dismiss screen {modally or remove subview} that would occur after you click the Send button on the SMS screen.  In iOS6.0 you cannot do that anymore.

     

    Your MFMessageViewController delegate method can still dismiss the SMS screen.   The dismiss or removal of the subview for your <SecondViewController> must occur separately.   The best place to remove the <SecondViewController> appears to be in the viewDidAppear method, which will be triggered after you dismiss the SMS <MFMessageComposeViewController> screen.

     

    Process

    Pre iOS6: load your screen, call MFMessage, dismiss your screen.

    iOS6: load your screen, call MFMessage, capture your screen reload event in viewDidAppear method, dismss your screen in viewDidAppear method.

     

    Hope the above helps.

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.