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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:31:29+00:00 2026-06-06T09:31:29+00:00

I am currently stuck on the part where user use his username and password

  • 0

I am currently stuck on the part where user use his username and password to view his data. I did try every piece of information on this website to find out how to make it work with no luck so far if anyone can point me in the right direction I’ll be grateful.

here is my .h file:

#import <UIKit/UIKit.h>




@interface ePaymentLoginViewController : UIViewController {
IBOutlet UITextField *__weak usernameField;
IBOutlet UITextField *__weak passwordField;
IBOutlet UIButton *__weak loginButton;
IBOutlet UIActivityIndicatorView *__weak loginIndicator;


}

@property (weak, nonatomic) UITextField *usernameField;

@property (weak, nonatomic) UITextField *passwordField;

@property (weak, nonatomic) UIButton *loginButton;

@property (weak, nonatomic) UIActivityIndicatorView *loginIndicator;


- (IBAction) login: (id) sender;


- (IBAction)backButton:(id)sender;

- (IBAction)cancelButton:(id)sender;






@end

here is my .m file:

#import "ePaymentLoginViewController.h"

@interface ePaymentLoginViewController ()

@end

@implementation ePaymentLoginViewController

@synthesize usernameField;
@synthesize passwordField;
@synthesize loginButton;
@synthesize loginIndicator;





- (IBAction) login: (id) sender
{
NSString *post =[NSString stringWithFormat:@"%@/%@",usernameField.text, passwordField.text];

NSString *hostStr = @"http://ourserver/mobilepay/MobilePayService.svc/verify/%@/%@";
hostStr = [hostStr stringByAppendingString:post];

NSData *dataURL =  [NSData dataWithContentsOfURL: [ NSURL URLWithString: hostStr ]];    
NSString *serverOutput = [[NSString alloc] initWithData:dataURL encoding: NSASCIIStringEncoding];

if([serverOutput isEqualToString:@"text/json"]){

    UIAlertView *alertsuccess = [[UIAlertView alloc] initWithTitle:@"Congrats" message:@"You are authorized" delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];

    [alertsuccess show];

} else {

    UIAlertView *alertsuccess = [[UIAlertView alloc] initWithTitle:@"Login Failed" message:@"Username or Password Incorrect" delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];

    [alertsuccess show];

    loginIndicator.hidden = TRUE;
    loginButton.enabled = TRUE;

 [loginIndicator startAnimating];


}

}




- (void)didReceiveMemoryWarning {
// Releases the view if it doesn’t have a superview.
[super didReceiveMemoryWarning];

// Release any cached data, images, etc that aren’t in use.
}

- (void)viewDidUnload {
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}




-(IBAction)backButton:(id)sender{

[self dismissViewControllerAnimated:YES completion:nil];

}
-(IBAction)cancelButton:(id)sender{

[self dismissViewControllerAnimated:YES completion:nil];

}



@end    

after successful login this is how the url should look and it will send JSON data

http://ourserver/mobilepay/MobilePayService.svc/verify/user123/test123    

{
   "Table": [
     {
       "comp_filenum": 1006842,
      "comp_namar": "username123",
      "comp_civid": "100000"
    }
  ],
  "Table1": [
    {
      "tran_num": 30301,
      "inst_val": 1725,
      "balance": 3450,
      "late_amount": 3450,
      "late_inst_no": 2,
      "legal_status": 0,
      "baloon_balance": 0,
      "late_bal_no": 0,
      "remain_bal_no": 0,
      "clienttype": 2,
      "filenumber": 1006842,
      "customername": "username123",
      "civilid": "100000",
      "saleprice": 82800,
      "costprice": 66005,
      "last_receiptnumber": "e22512",
      "last_paydate": "2012-05-02T00:00:00",
      "last_payamount": 1725,
      "paidamount": 79350,
      "remaininginstallment": 16
    },

So what am i doing wrong at this point and what is the right way to do it.

  • 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-06T09:31:30+00:00Added an answer on June 6, 2026 at 9:31 am

    Try with below line :

    NSString *hostStr = [NSString stringWithFormat:@"http://ourserver/mobilepay/MobilePayService.svc/verify/%@/%@",usernameField.text, passwordField.text]; 
    NSURL *aURL = [NSURL URLWithString: hostStr]; 
    NSLog(@"%@",aURL); // check the log 
    
    NSData *dataURL =  [NSData dataWithContentsOfURL:aURL];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently stuck at the part whenever I drag a HTML5 slider, it
I have a WSS list containing user profile data (Columns: Username, Name, DOB) etc.
i am stuck in the part where i have to log out the currently
I'm currently designing/reworking the databinding part of an application that makes heavy use of
I'm currently stuck with using Atom CPU desktop for my Android app development. What
I am currently stuck at this problem right now where I don't seem to
I am currently stuck, having two separate glossaries: main & acronyms . Acronyms glossary
I'm currently stuck on this problem. I've hooked into the method_missing function in a
My app, tommienutest is currently stuck in Awaiting Recurring Charge Cancellation-limbo. Is there any
I'm just getting started with Visual Basic .NET and I'm currently stuck on the

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.