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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:28:08+00:00 2026-06-10T11:28:08+00:00

I am new to storyboard and xcode (using 4.4) I would like to implement

  • 0

I am new to storyboard and xcode (using 4.4)

I would like to implement a login condition, that if accomplished – the segue would work. Otherwise, the user should stay on the same view.

I created 2 UIView: ViewController and Bar Controller.

I also created a segue from ViewController to Bar Controller and set its identifier to loginSegue as modal.

In LoginViewController.m I added the following:

- (IBAction)login:(id)sender {
    self.email = self.emailText.text;
    self.password = self.passwordText.text;
   if ([self.email isEqualToString:@"O"] && [self.password isEqualToString:@"O"])
       [self performSegueWithIdentifier:@"LoginSegue" sender:sender];
    else
        [passwordText setText:@""];   
}

When I debug the code – I see that the if skips to else in case of email and password that to not equal to O, however the segue (transition to the new view) still happens.

How can I prevent the user to be transferred to the new view?

BTW, if I remove the if else condition – the user is being transferred to the next view automatically. It seems to me that it was configured somewhere when I drew the segue from one view to the other.

  • 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-10T11:28:10+00:00Added an answer on June 10, 2026 at 11:28 am

    Delete the blank line in between your if and [self perform...]

    Additionally, you may want to consider keeping your if-else statements in braces to keep this problem from happening again:

    if ([self.email isEqualToString:@"O"] && [self.password isEqualToString:@"O"]){
        [self performSegueWithIdentifier:@"LoginSegue" sender:sender];
    }else{
        [passwordText setText:@""];
    }
    

    If this doesn’t solve the problem then be sure to varify that the segue is attached to the two controllers and not directly to a button.

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

Sidebar

Related Questions

I am developing a storyboard-based application, using XCode 4.2. I'm new to storyboards, before
I am quite new to Xcode coding and I have been using Storyboard for
I am new to iphone development. I am using xCode 4.2 with storyboard. I
Using XCode 4, I created a NEW TabBar Application using the default storyboard settings.
Background: Up until Xcode 4.2, new projects created using any of the templates would
starting a new project and want to try using the storyboard feature of xcode
I have started a new Storyboard (iPad) based XCode project that should have a
Possible Duplicate: How to create custom modal segue in 4.2 Xcode using storyboard So
I am very much new to IOS. I am using the storyboard feature to
I'm new to Xcode 4.2 and have a Storyboard array question. I'm doing a

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.