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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:42:19+00:00 2026-06-15T14:42:19+00:00

Possible Duplicate: ios making a button change view when text field equals string I

  • 0

Possible Duplicate:
ios making a button change view when text field equals string

I have this problem here. I want the same button to change View Controller depending on whats written in the textfield…
This is my code so far:

 - (IBAction)button:(id)sender {
  if ([txt.text isEqualToString:@"passwordToSkipLevel1"]) {
  // Code to change View Controller to Level1?
  } else if ([txt.text isEqualToString:@"passwordToSkipLevel2"]) {
  // Code to change View Controller to Level2?
  } else if ([txt.text isEqualToString:@"passwordToSkipLevel3"]) {
  // Code to change View Controller to Level3?
  } else if ([txt.text isEqualToString:@"passwordToSkipLevel4"]) {
  // Code to change View Controller to Level4?
  } 
}

Here my problem is if I can only have one segue on each button, but I want one button to change View Controller to multiple different views depending on what password that is written in the textfield..

PS: If the button is pressed when there is nothing in the textfield or text that aint any correct password I dont want the button to so anything at all.

  • 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-15T14:42:20+00:00Added an answer on June 15, 2026 at 2:42 pm

    Connect all your segues to the controller, and give your segues identifiers in IB and use :

    [self performSegueWithIdentifier:identifier sender:nil];

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

Sidebar

Related Questions

Possible Duplicate: Reading in a text file in iOS This is a really dumb
Possible Duplicate: iOS - Passing variable to view controller I have two Viewcontrollers (ViewController1
Possible Duplicate: iOS compare button title to string Can someone tell me how to
Possible Duplicate: presentViewController: crash on iOS 6 (AutoLayout) I'm getting this error when clicking
Possible Duplicate: Best radio-button implementation for IOS I am looking at my storyboard and
Possible Duplicate: Python or Ruby Interpreter on iOS I just discovered this apps pypad
Possible Duplicate: Change icon on of an App in iOS 4 in run-time Is
Possible Duplicate: iPhone development on PC I have developed an iOS native application. My
Possible Duplicate: Determine device (iPhone, iPod Touch) with iOS I am making a game
Possible Duplicate: A non-nested animation sequence in jQuery? I have an html/css/js iOS app

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.