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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T00:07:17+00:00 2026-06-17T00:07:17+00:00

Really new with objective c (building iphone app) and I’m trying to figure out

  • 0

Really new with objective c (building iphone app) and I’m trying to figure out how to properly understand how calling methods work (compared to c#, the most recent language I’ve been working with)

I have this implementation

@interface User : NSObject{
}

@property NSInteger Id;
@property NSString *email, *password;
-(BOOL)isValid;
@end

@implementation User

-(BOOL)isValid{
  NSString *password = self.validateString:self.password;
  NSString *email = self.email;

  if(validUser){
     return YES;
  }else{
     return NO;
  }
}

EDIT: SOrry if it wasn’t clear but this is the method I’m trying to call.

-(NSString *)validateString:(NSString *)string{
    // process the string
    return @"";
}

Basically I’m trying to create an instance in my view onclick of a button like so:

- (IBAction)btnSubmit:(id)sender {
    // get values of email and password

    // do an isvalid to check with web service.
    User *user = [[User alloc] init];
    user.email = @"email@email.com";
    user.rawPassword = @"pass";

    if(user.isValid){
        // go to next page
    }
    else{
        // else refresh current page
    }
}

Is creating the instance on click and then passwing the values to process inside the instance a good practice?

Thanks!

  • 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-17T00:07:18+00:00Added an answer on June 17, 2026 at 12:07 am

    No need of creating it’s own object there. You can use the current object for doing this:

    - (IBAction)btnSubmit:(id)sender
      {    
        self.email = @"email@email.com";
        self.rawPassword = @"pass";
    
        if(self.isValid)
        {
            // go to next page
        }
        else
        {
            // else refresh current page
        }
    }
    

    You can refer to same object within its scope using self keyword. It’s similar to this keyword used in C++

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

Sidebar

Related Questions

Being fairly new to objective-c and developing for ios I'm trying to figure out
I am quite new to Objective-C and Cocos2d, and i don't really understand why
I'm fairly new to Objective-C and cocoa programming, so I don't really understand the
I'm really new to OOP and C# and I'm trying to understand, how I
I'm developing an iPhone app, and I'm kinda new to Objective-C and also the
I'm really new to C programming and I'm still trying to understand the concept
I'm new to objective-c and I'm trying to understand Xcode. Right now, I'm in
So new to objective-c and iphone/ipad development. Trying to get my feet wet with
I am new Objective C. I am trying to understand and workout problems from
Hey there, I'm a designer thats really new to programming with xcode or Objective-C

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.