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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:21:48+00:00 2026-05-23T23:21:48+00:00

My question is pretty simple: On the iPhone/iPad simulator, when you push a nil

  • 0

My question is pretty simple:
On the iPhone/iPad simulator, when you push a nil view Controller, you are greeted by the gracious message

Application tried to push a nil view controller on target

after which the app continues execution as if nothing happened. This is exactly the type of behavior I want of the app (I have a factory method, which, if encounters an incorrect request for the creation of an instance, returns nil).

However I have doubts as to whether this will fly as is on the real iOS device. Since I cannot deploy in this early stage of development, I would like to know whether this action would result in a crash, or it will graciously do nothing (as expected). Furthermore, if it works on the iOS, will I get slapped by Apple in the review process for doing ‘bad things’?

  • 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-23T23:21:49+00:00Added an answer on May 23, 2026 at 11:21 pm

    When it comes to Cocoa Touch methods, you should never pass a nil parameter unless the reference documentation explicitly states that a nil parameter is valid. If the documentation is ambiguous, don’t rely on empirical testing (in the simulator or otherwise) to decide that it’s safe. Apple may release a future OS update that suddenly causes your app to start crashing for your existing users. Then they’ll give your app bad reviews for a week or two while Apple reviews your hotfix. It’s just not worth the risk.

    The documentation for pushViewController:animated: doesn’t specify how it will behave if given a nil parameter, so play it safe and test for nil in your code.

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

Sidebar

Related Questions

My question is pretty simple: If you have two web-application components: Server-side (secret-capable) code
I'm building my very first iPhone application. It's pretty simple, I'm displaying two lists
OK, My question is pretty simple, I am developing an application to deploy on
I think the question is pretty simple, do I need all the rest of
Pretty simple question: When i have a persistable object, it usually has a property
Pretty simple question, I'm writing an XML document and i'm not sure how to
Pretty simple question. I have a few ASP RequiredFieldValdators checking some text boxes. Out
Pretty simple question. I've got some Polygons and GroundOverlays defined in KML. Is there
This is a pretty simple question but I'm somewhat stumped. I am capturing sections
I have a pretty simple question which perhaps someone familiar with Server/Client design &

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.