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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:43:45+00:00 2026-05-27T03:43:45+00:00

Here I have tried to get connected with the server. It says CONNECTION SUCCESSFUL.

  • 0

Here I have tried to get connected with the server. It says CONNECTION SUCCESSFUL. What I want to know is that that how can I go to another view when connection is successful?
I am a newbie please give your suggestion.. ?

here is the login button code

-(IBAction)loginButton:(id)sender
{
    NSString *uName = [userName text];
    NSString *pWord = [password text];
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    [defaults setObject:uName forKey:@"uName"];
    [defaults setObject:pWord forKey:@"pWord"];
    [defaults synchronize];
    NSLog(@"Data Saved");
    NSString *post = [NSString stringWithFormat:@"&Username=%@&Password=%@", userName.text, password.text];
    NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
    NSString *postlength = [NSString stringWithFormat:@"%d", [postData length]];
    NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
    [request setURL:[NSURL URLWithString:[NSString stringWithFormat:@"myurl"]]];
    [request setHTTPMethod:@"POST"];
    [request setValue:postlength forHTTPHeaderField:@"Content-Length"];
    [request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Current-Type"];
    [request setHTTPBody:postData];
    NSURLConnection *conn = [[NSURLConnection alloc]initWithRequest:request delegate:self];

    if(conn){
        if(conn){
            MainView *mainView = [[MainView alloc]initWithNibName:@"MainScreen" bundle:nil];
            self.mView = mainView;
        }
        NSLog(@"Connection successful");
    }
    else{
        NSLog(@"Connection failed");
    }   
}

thanks in advance 🙂

  • 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-27T03:43:46+00:00Added an answer on May 27, 2026 at 3:43 am

    You need to add the new view as a subview to show it. This will work if the class calling is the main view controller class:

    if(conn){
            MainView *mainView = [[MainView alloc]initWithNibName:@"MainScreen" bundle:nil];
            self.mView = mainView;
           [self.view addSubview: mainView.view];
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having an issue here that I have tried everything I can think of but
Here is what I have. I have tried several things but I can't figure
So I have a django server running on my local machine that I want
I have the following issue here: I want to write a server streaming data
Here is what I have tried thus far: > cd /Applications/MAMP/bin/php5/bin/ > ./pear channel-discover
Here is the code I have tried to append a node in existing xml,
gem install heroku failed with following message and I have tried the solution here
Complete new person to Ruby and Rails here... Have tried some tutorials in the
I am sorry about the amount of code here. I have tried to show
I have installed MySQL server 5 on redhat linux. I can't login as root

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.