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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:18:57+00:00 2026-06-01T04:18:57+00:00

Currently using Xcode 4.2 and I have two view controllers (1 and 2). I

  • 0

Currently using Xcode 4.2 and I have two view controllers (1 and 2). I have a number of textfields in viewcontroller1 that need to be filled in before the user is able to click the “Next” button which then goes to viewcontroller2. I have got alertdialogs that popup if the user hasn’t filled in all the textfields.

I have used the storyboard to segue the button click which works fine, except if the textfields are empty, my alertdialog pops up but the view controller still changes to number 2.

How do i make it so that only if my if/else statements are met, does the next button go to the next view controller.

I am using a navigation controller to control the view controllers.

I tried to put the following code into the if/else statement but it didn’t work:

UIViewController *secondViewController = [[SecondViewControllerClass alloc] initWithNibName:@"<name of xib>" bundle:nil];
[self presentModalViewController:secondViewController animated:YES];

Now there was a few things I was unsure about when trying to find out how to use this method. Do i need to import the SecondViewController.m at the top of the firstviewcontroller.m?

  • 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-01T04:18:58+00:00Added an answer on June 1, 2026 at 4:18 am

    NSString has a helpful property called length, which will return nil if a textfield contains no text. If you need to check, call:

    if (!myTextField.text.length) { 
        //no text in the box
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently, I have an iPhone app published in AppStore. I've developed it using XCode
I am currently switching from developing two separate Xcode Projects into using Xcode workspace.
I am currently using XCode 3.2.3 and iOS4. I'm working on an app that
I have an iPhone app that is currently using the test environment for iAds.
I currently have Xcode 4.1 installed. I attempted to update using the App Store
Currently I am using xCode 3.2.5 and I have already installed cocos2d template cocos2d
Currently using System.Web.UI.WebControls.FileUpload wrapped in our own control. We have licenses for Telerik. I
I am currently using Windows Server 2008 Standard and have several Hyper V machines.
I have an application that is supposed to be localized (two languages, english being
I have two XCode projects: a framework and a client application. My application depends

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.