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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:22:23+00:00 2026-06-02T17:22:23+00:00

I am first time implementing json in my app. and in my app I

  • 0

I am first time implementing json in my app.

and in my app I have to pass parameters from my app to webservice and according to that i can get response from web service but I am not able to find any tutorial in which I can pass parameters from my app in ios5

so is there any tutorial on net from which I can get tutorial which is useful to me.

I tried to find using google but i did not succeed.

  • 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-02T17:22:24+00:00Added an answer on June 2, 2026 at 5:22 pm

    Following steps follow for the integrate the json in to our project.

    1) Copy paste the below file into your project.

    2) Create new Group name as help which contain the following files.

    3) Create the new file into Support Files which is name as a constant.h

    #define WEB_SERVICE_URL @"Your server url" //@"http://demo.google.com/webservice/"
    
    #define USERNAME @"Your user id"//static username to send everytime
    #define PASSWORD @"Your Password"//static password to send everytime
    

    4) Change the above the variable link where is your web service exist that means url of your webservice ”WEB_SERVICE_URL”

    5) Open “Rest.h” file and create the one method.

    -(void)Get_StoreDetails:(SEL)seletor andHandler:(NSObject*)handler andCountryId:(NSString *)CountryCode;
    

    6) Open “Rest.m” file and which argument to pass to server that method to code.

    -(void)Get_StoreDetails:(SEL)seletor andHandler:(NSObject *)handler andCountryId:(NSString *)country_id{
        NSDictionary *req = [NSDictionary dictionaryWithObjectsAndKeys:@"content/get_stores",@"request",
                             [NSDictionary dictionaryWithObjectsAndKeys:USERNAME,@"username",
                              PASSWORD,@"password",
                              country_id,@"country_id",
                              nil],@"para",nil];
        [[[JSONParser alloc] initWithRequest:req sel:seletor andHandler:handler] autorelease];
    
    }
    

    7) now the Rest application is ready for the send the request and then now this method call in to our view controller.

    Following code put into the “viewWillAppear” method in .h file

    #import <UIKit/UIKit.h>
    
    @interface JsonDemoAppViewController : UIViewController{
        UIAlertView *alertCtr;
    }
    
    @property(nonatomic,retain)NSMutableArray *arrForStores;
    - (void)getData:(id)object;
    @end
    

    Following code put into the “viewWillAppear” method in .m file and import “Rest.h”.

    - (void)viewWillAppear:(BOOL)animated {
        self.arrForStores=nil;
        //============================Json Initialization===================================================
        REST *rest = [[REST alloc] init];
        [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
        [rest Get_StoreDetails:@selector(getData:) andHandler:self andCountryId:@"12"];
    
        alertCtr = [[[UIAlertView alloc] initWithTitle:@"\nPlease Wait..." message:nil delegate:self cancelButtonTitle:nil otherButtonTitles: nil] autorelease];
        [alertCtr show];
    
        UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
    
        // Adjust the indicator so it is up a few pixels from the bottom of the alert
        indicator.center = CGPointMake(alertCtr.bounds.size.width / 2, alertCtr.bounds.size.height - 50);
        [indicator startAnimating];
        [alertCtr addSubview:indicator];
        [indicator release];
        //===================================================================================================
    
    }
    

    Then the reply comes into server that time object store into the variable that time we create the metod which calls.

    - (void)getData:(id)object{
        NSLog(@"%@",object);
        if ([object isKindOfClass:[NSDictionary class]]) {
            NSLog(@"Controll comes here..");
            //IF your response type is NSDictionary then this code to run
        }
    
        if ([object isKindOfClass:[NSArray class]])
        {
            self.arrForStores=[NSArray arrayWithArray:(NSArray*)object];
            //IF your response type is NSArray then this code to run
        }
    
        [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
        [alertCtr dismissWithClickedButtonIndex:0 animated:YES];
    
    }
    

    Download the source code From Here

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

Sidebar

Related Questions

This is my first time implementing In App Purchases. During development and testing of
I am implementing, for the first time, Json.NET for my ASP.NET MVC2 site. My
first time use JTree. Just wondering is it possible to have more than one
First time Stack Overflow poster. Please bear with me! :) I have a set
Right now I have this social media app, where I'm implementing ratings on users
It's almost the first time I'm implementing a table view in my code. I
I am implementing a php page counter that will keep track of each time
From a blog: The basic idea with CSS expressions is that you will have
I'm implementing stateless session bean ejb3 in glassfish server using netbeans. First time, it
It's the first time I use java Rmi*. I have a custom class which

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.