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

  • Home
  • SEARCH
  • 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 9183207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:44:46+00:00 2026-06-17T18:44:46+00:00

i have just started learning objective C. want to create a small app where

  • 0

i have just started learning objective C. want to create a small app where a login page should be there and password should be accepted only if its length is more than or equal to 8. once you submit that the next page should be a list of movies and in that page there should be a search button as well as add and remove buttons which can make that list editable. i created the login page and i have directly linked the submit button with the movie list page coz i was confused about how the condition of password length and username thing should be validated. kindly help me in doing that and to get the proper editing buttons for my movie list page.

Thanks

“ViewController.m”

#import "ViewController.h"
#import "MovieList.h"
@interface ViewController ()
@end
@implementation ViewController
-(void)loadView{
self.view = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
self.view.backgroundColor = [UIColor cyanColor];
UILabel *name=[[UILabel alloc] init];
UILabel *pass=[[UILabel alloc] init];
UITextField *username = [[UITextField alloc]init];
UITextField *password = [[UITextField alloc]init];
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[name setBackgroundColor:[UIColor cyanColor]];
[name setText:@"UserID"];
[name setTextColor:[UIColor blackColor]];
[pass setBackgroundColor:[UIColor cyanColor]];
[pass setText:@"Password"];
[pass setTextColor:[UIColor blackColor]];
[button setTitle:@"SUBMIT" forState:UIControlStateNormal];
username.delegate = self;
password.delegate = self;
username.borderStyle = UITextBorderStyleRoundedRect;
password.borderStyle = UITextBorderStyleRoundedRect;
name.frame = CGRectMake(20, 15, 80, 20);
pass.frame = CGRectMake(15, 55, 80, 20);
username.frame = CGRectMake(100, 10, 200, 30);
password.frame = CGRectMake(100, 50, 200, 30);
button.frame = CGRectMake(130, 90, 80, 30);
[self.view addSubview:button];
[self.view addSubview:username];
[self.view addSubview:password];
[self.view addSubview:name];
[self.view addSubview:pass];
[button addTarget:self action:@selector(gotosecondpage)  forControlEvents:UIControlEventTouchUpInside];
}
-(void)gotosecondpage
{
Movielist *secondViewcont = [[Movielist alloc] init];
[self.navigationController pushViewController:secondViewcont animated:YES];
}
- (void)viewDidLoad
{
[super viewDidLoad];
}
- (void)viewDidUnload
{
[super viewDidUnload];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:  (UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range   replacementString:(NSString *)string{
return YES;
}
- (BOOL)textFieldShouldClear:(UITextField *)textField{
return YES;
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField{
[textField resignFirstResponder];
return YES;
}
@end

“MovieList.m”

#import "MovieList.h"
@interface Movielist()
@end
@implementation Movielist
-(void)loadView{
self.view = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
self.view.backgroundColor = [UIColor cyanColor];
}
-(id)init{
[self.navigationItem setTitle:@"Movie List"];
return self;
}
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
    [self.view setBackgroundColor:[UIColor cyanColor]];
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
CGRect frame = self.view.frame;
UITableView *tableView = [[UITableView alloc] initWithFrame:frame   style:UITableViewStylePlain];

tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
tableView.backgroundColor = [UIColor cyanColor];
tableView.delegate = self;
tableView.dataSource = self;
[self.view addSubview:tableView];
[tableView setScrollEnabled:YES];
[tableView setUserInteractionEnabled:YES];
[tableView setRowHeight:35];
}
- (void)viewDidUnload
{
[super viewDidUnload];
}
- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 20;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cellIDent"];
char ch = 'a' + indexPath.row;
cell.textLabel.text = [NSString stringWithFormat:@"%c" , ch];
    return cell;
}
@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-06-17T18:44:48+00:00Added an answer on June 17, 2026 at 6:44 pm

    Checking length is very straight. The important thing is how do you navigate from login page. Currently I see gotosecondpage function is responsible. You can probably write a validateParams method, under which you can call gotosecondpage if all conditions are met.

    This code will tell you about password length:

    -(void) validateParams 
    {
        NSString * password = [password text];
        if ([password length] < 8) //and maybe other conditions, too
        {
           [self gotosecondpage];
        }    
        else
        {
           //report error - maybe show some UILabel near username / password fields to show which one of them went wrong
        }
    }
    

    Note that there are many other things you can do – like telling the user which field needs correction, and there are many better ways. Since your requirements are quite basic, above should help for now.

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

Sidebar

Related Questions

I have just started learning PHP and I want to create a website with
I have just started learning python version 3 and trying to create a file
I have just started learning Javascript. I want Hello World! to be written to
I have just started learning GWT. My question is pretty simple: If I create
Hi I have just started learning about xsd as I want to use it
I just started learning Objective-C and OOP ... so I have very stupid question
I have just started learning Objective-C, I am reading Programming in Objective-C 3rd Edition
I have just started learning Quick Form . I want to know how can
I just started learning objective c. I have this little problems and questions, hope
I have started learning Objective-C, and I just wanted to verify that my understanding

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.