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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:33:18+00:00 2026-05-22T02:33:18+00:00

i m making a client server program in which i want to switch from

  • 0

i m making a client server program in which i want to switch from one view to another but i am getting an error in “clientserverprogram view.m” plz help

"clientserverprogram view.h" 

#import <UIKit/UIKit.h>

@class secondview;

@interface clientserverprogramViewController : UIViewController {

    IBOutlet UITextField *name;
    IBOutlet UITextView *filepath;
    IBOutlet UIButton *print;
    IBOutlet UIButton *settings;
    IBOutlet UIButton *cancel;
    IBOutlet UILabel *display;
    IBOutlet secondview *secondview;
}

-(IBAction) print;
-(IBAction) settings;
-(IBAction) cancel;

@property (nonatomic , retain) IBOutlet UITextField *name;
@property (nonatomic , retain) IBOutlet UITextView *filepath;

@property (nonatomic , retain) IBOutlet UILabel *display;
@end




"clientserverprogram view.m"


#import "clientserverprogramViewController.h"
#import "secondview.h"


@implementation clientserverprogramViewController

@synthesize  name ,filepath,display ;

-(IBAction) print {

    NSString *str = name.text;


    [display setText : str];

}

-(IBAction) settings {


    [self presentModalViewController: secondview animated: YES ];

"" error: expected expression before 'secondview'"" 


}


-(IBAction) cancel {


    exit(0);

}


- (void)dealloc {
    [super dealloc];
}

@end


"secondview.h"


#import <UIKit/UIKit.h>


@interface secondview : UIViewController {

    IBOutlet UIView *view;

    IBOutlet UIButton *back;

}

-(IBAction) back;



@end



""secondview.m""


#import "secondview.h"


@implementation secondview




-(IBAction) back {

    [self.parentViewController dismissModalViewControllerAnimated: YES];
}


- (void)dealloc {
    [super dealloc];
}


@end
  • 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-22T02:33:18+00:00Added an answer on May 22, 2026 at 2:33 am
    [self presentModalViewController: secondview animated: YES ];
    
    "" error: expected expression before 'secondview'""
    

    This line of code is responsible to present modal ViewController. In your case you only had a view. So either you create a controller for the second view like that:

    SecondViewController *secondController=[[SecondViewController  alloc] initWithNibName:@"secondView" bundle:[NSBundle mainBundle]];
     [self presentModalViewController:secondController animated: YES ];
    

    or you can load you second view from nib file using outlet and you can add it as subview to your current view controller view:

    [self.view addSubView:secondview]; 
    

    Update

    As I can see on your code SecondView is your controller not the view, but you are try to present a controller that is not initialized. I also noticed that you have an outlet for your view on SecondView, when you create a new sub class of UIViewController you can check the option that creates a .xib file as well.

    Hope that helps,

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

Sidebar

Related Questions

I'm making a client-server program for iphone and i want to use my serverIP
I'm making a client-server program for iphone and i want to use my serverIP
i am making a client server program in java, a portion of which requires
I'm making a client-server program for picking a file from a location on a
I'm writing my first java client/server program which just establishes a connection with the
I am making a protocol, client and server which provide file transfer functionality similar
i am making a client server program for iphone communication with the sever i
My iPhone client app uploads a data to the server, which runs on PHP.
Here's the quick background: I've got a client and a server program that are
this is probably trivial but I need help in making my server listen on

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.