0

I'm using MFMessageComposeViewController to send SMS from iPhone devices.

This works correctly with iOS 5 and later.

But in iOS 4.3 I can send SMS only once correctly. All next attempts present me MFMessageComposeViewController with data from first SMS.

I'm using Xcode 4.3.2 with ARC enabled.

Misha
  • 5,260
  • 6
  • 35
  • 63
  • 1
    your `MFMessageComposeViewController` does not dealloc after sending & dismissal. Try to set it to `null` and re-create it in next SMS sending. – Raptor Oct 15 '12 at 07:49
  • I'm allocating it again in method each time i want to send SMS – Misha Oct 15 '12 at 08:48
  • are you sure you are allocating the same controller? try to set it to `null` and retry . – Raptor Oct 15 '12 at 09:04
  • 1
    Ok found the problem. I had to call [controller dismissModalViewControllerAnimated:YES]; in - (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result – Misha Oct 15 '12 at 09:33
  • correct ! please make it as an answer . – Raptor Oct 15 '12 at 11:09

1 Answers1

0

By Shivan Raptor's request:

There is a need to call

[controller dismissModalViewControllerAnimated:YES]; 

in -

(void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result
Misha
  • 5,260
  • 6
  • 35
  • 63