Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8318181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:52:25+00:00 2026-06-08T21:52:25+00:00

Since debugging is extremely slow with Xcode 4.3 on iOS 5.1 when starting/installing the

  • 0

Since debugging is extremely slow with Xcode 4.3 on iOS 5.1 when starting/installing the app on the device I use the simulator which starts much faster. (see my question regarding this issue here https://stackoverflow.com/questions/11541288/xcode-4-3-with-ios5-1-pauses-about-10secs-when-debug-starts-simulator-starts-i)

So all I need to do is something like this:

MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init];
picker.messageComposeDelegate = delegate;
NSString *s = @"1234567";
picker.recipients =[NSArray arrayWithObject: s];   
picker.body =smsTxt;
if (simulationMode) {
    MessageComposeResult result = MessageComposeResultSent;            <-----------
    [delegate messageComposeViewController:picker didFinishWithResult: result];
} else
    [delegate presentModalViewController:picker animated:YES];

Here the problem is now that when executing on iOS-Simulator the MFMessageComposeViewController can’t be instantiated and always yields nil.

Is there a way to create another object MyOwnMFMessageComposeViewController on iOS simulator which is compatible to MFMessageComposeViewController and can be passed in the same method like MFMessageComposeViewController?

Something like this:

    MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init];
    picker.messageComposeDelegate = delegate;
    NSString *s = @"1234567";
    picker.recipients =[NSArray arrayWithObject: s];   
    picker.body =smsTxt;
    if (simulationMode) {
        MyOwnMFMessageComposeViewController *mypicker = [[MFMessageComposeViewController alloc] init];
        mypicker.messageComposeDelegate = delegate;
        NSString *s = @"1234567";
        mypicker.recipients =[NSArray arrayWithObject: s];   
        mypicker.body =smsTxt;
        MessageComposeResult result = MessageComposeResultSent;   
        picker = (MFMessageComposeViewController) mypicker;          
        [delegate messageComposeViewController:picker didFinishWithResult: result];
    } else
        [delegate presentModalViewController:picker animated:YES];
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T21:52:28+00:00Added an answer on June 8, 2026 at 9:52 pm

    What you are looking for is called a ‘mock object’ and is often used in test driven development. Basically what you do is create a subclass of MFMessageComposeViewController. This subclass works exactly the same as mfmessagecomposeviewcontroller except you also create instance variables to show that something has happened.

    So for example when your delegate calls messageComposeViewController:didFinishWithResult. The mock object would likely store the result and a flag that that method had been fired. Note that this won’t actually send anything, but simply tells you that the delegate fired and on a real object will work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my C++-code there are several fprintf-statements, which I have used for debugging. Since
Since a few days I'm unable to start resque I have tried debugging this
Since regular jQuery animations are not fluent on iOS ( .hide() , slideDown() ),
since today im facing a strange problem. When i start my app in my
Since I am developing an iOS >= 5.0 application, I am trying to change
Since now I have only used plugin for editing and the way I use
Since input and raw_input() stop the program from running anymore, I want to use
I have been working and debugging with NetBeans since almost a year with 0
I have been having a really hard time debugging this error since the past
I need to print some structure for debugging purposes.Since the code base is huge

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.