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 6876253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:27:15+00:00 2026-05-27T04:27:15+00:00

I am trying to write some application tests for my app based on the

  • 0

I am trying to write some application tests for my app based on the iPhoneUnitTests examples on Apple dev site. Particularly I am having trouble “tapping” through elements in the app, that is, simulating the tap calling methods that make view controllers appear o disappear.

For instance I have this test:

- (void)testAddMeal
{
  HomeScreenController *hsCtrl = (HomeScreenController*)mainViewController;
  [hsCtrl tableView:hsCtrl.tblView didSelectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
  nutritionStrategyController = (NutritionStrategyController*)((UINavigationController*)mainViewController.modalViewController).topViewController;
  [nutritionStrategyController tableView:nutritionStrategyController.tblView didSelectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:1]];
}

Which opens a first UIViewController selecting a table cell and then a second UIViewController should appear selecting a table cell in the new UIViewController.
Problem is, the test fails with this error:

 Unknown.m:0: error: -[NutritionStrategyTests testAddMeal] : Attempting to begin a modal transition from <UINavigationController: 0x113a2fc0> to <NewMealTrackingController: 0x9353090> while a transition is already in progress. Wait for viewDidAppear/viewDidDisappear to know the current transition has completed

So my question is, how do I create a test for this?

  • 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-05-27T04:27:16+00:00Added an answer on May 27, 2026 at 4:27 am

    Unit tests are for testing the behavior of specific bits of code, classes, modules etc. If you want to automate user input, it is a different kind of test, you can look into the UIAutomation instrument, which is dedicated to this type of testing.

    The Automation instrument, guided by your test scripts, exercises the
    user interface elements of your application, allowing you to log the
    results for your analysis. The Automation feature can simulate many
    user actions supported by devices that support multitasking and run
    iOS 4.0 or later. Your test script can run both on the iOS device and
    in the iOS Simulator without modification.

    An important benefit of the Automation instrument is that you can use
    it with other instruments to perform sophisticated tests such as
    tracking down memory leaks and isolating causes of performance
    problems.

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

Sidebar

Related Questions

I'm trying to write some tests for an MVC application we're developing. We have
I have a multilingual application and I am trying to write some tests for
I'm trying to write some JUnit tests for an Android application. I've read online
I have a GWT application for which I'm trying to write some tests using
I've got a Sencha Touch MVC app that I'm trying to write some tests
I'm trying to write a small wsgi application which will put some objects to
I'm trying to write a web application using SpringMVC. Normally I'd just map some
I'm trying to write a plugin system to provide some extensibility to an application
I'm trying to write some code to find a specific XmlNode object based on
I am trying to write Watin tests for an intranet application that uses Integrated

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.