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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:12:16+00:00 2026-06-04T07:12:16+00:00

I can’t get exact out put after JSON parsing. strURLRootView is NSString Object of

  • 0

I can’t get exact out put after JSON parsing.

strURLRootView is NSString Object of “RootViewController.m” class…

strURLRootView = txt_EnterURL.text;

strURLRank is also the NSString Object of “CheckRank_ViewController.m” class…

strURLRank = strURLRootView;

-(void)viewDidLoad

{

    [self startJSONParsing];

    [super viewDidLoad];
}

-(void)startJSONParsing

{

    responseData = [[NSMutableData data] retain];
    ArrData = [NSMutableArray array];

    NSString *stringWithoutSpaces = [NSString stringWithFormat:@"http://lsapi.seomoz.com/linkscape/url-metrics/%@%2fblog?AccessID=member-10fd5cb877&Expires=1365850483&Signature=m%2F7hZu1y7Sa00NGLFKHYY%2FO3TB4%3D",strURLRank];

if i use

@”http://lsapi.seomoz.com/linkscape/url-metrics/www.yahoo.com%2fblog?AccessID=member-10fd5cb877&Expires=1365850483&Signature=m%2F7hZu1y7Sa00NGLFKHYY%2FO3TB4%3D”

this URL Statically it will give exact out put.

    NSLog(@"stringWithoutSpaces is:--> %@\n\n",stringWithoutSpaces);

    NSURLRequest *request1 = [NSURLRequest requestWithURL:


                             [NSURL URLWithString:stringWithoutSpaces]];
    NSLog(@"request1 is:--> %@\n",request1);

    [[NSURLConnection alloc] initWithRequest:request1 delegate:self];


}

(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response

{

    [responseData setLength:0];

}

(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data

{

    [responseData appendData:data];

}

(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error

{

    NSLog(@"Error occured at the time of parsing...");

}

(void)connectionDidFinishLoading:(NSURLConnection *)connection

{

    [connection release];
    NSString *responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
    [responseData release];

    results = [responseString JSONValue];

    lbl_RootDomain.text = [results objectForKey:@"upl"];
    lbl_URL.text = [results objectForKey:@"uu"];
    lbl_Title.text = [results objectForKey:@"ut"];
    lbl_SubDomain.text = [NSString stringWithFormat:@"%f",[[results objectForKey:@"fmrp"] floatValue]];
    lbl_MozRank.text = [NSString stringWithFormat:@"%f",[[results objectForKey:@"umrp"] floatValue]];
    lbl_DomainAutho.text = [NSString stringWithFormat:@"%d",[[results objectForKey:@"pda"] intValue]];
    lbl_XternalLinks.text = [NSString stringWithFormat:@"%d",[[results objectForKey:@"ueid"] intValue]];
    lbl_Links.text = [NSString stringWithFormat:@"%d",[[results objectForKey:@"uid"] intValue]];
    lbl_PageAutho.text = [NSString stringWithFormat:@"%f",[[results objectForKey:@"upa"] floatValue]];

    NSLog(@"results data is:--> %@",results);

    NSString *str = [NSString stringWithFormat:@"Root Domain: %@\n URL: %@\n Title: %@\n Subdomain mozRank: %@\n MozRank: %@\n Domain Authority: %@\n External Links: %@\n Links: %@\n Page Authority: %@\n",lbl_RootDomain.text,lbl_URL.text,lbl_Title.text,lbl_SubDomain.text,lbl_MozRank.text,lbl_DomainAutho.text,lbl_XternalLinks.text,lbl_Links.text,lbl_PageAutho.text];

    NSLog(@"mail data is:--> \n\n %@",str);
}

I am not getting the exact problem in coding. If i am wrong in coding then please tell me what is wrong.

Thanks in advance.

  • 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-04T07:12:17+00:00Added an answer on June 4, 2026 at 7:12 am

    ……… Maulik Trambadiya Solution ……….

    -(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
    {
        [responseData setLength: 0];
    }
    
    -(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
    {   
        [responseData appendData:data];
    }
    
    -(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
    {
        [connection release];
        [responseData release];
    
    }
    
    -(void)connectionDidFinishLoading:(NSURLConnection *)connection
    {
        NSString *responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
        responseData = nil;
        NSLog(@"%@",responseString);
        SBJsonParser *parser = [[[SBJsonParser alloc] init] autorelease];
        NSDictionary *responseDict = [parser objectWithString:responseString];
        NSLog(@"%@",responseDict);
        [responseDict retain];    
    }
    
    - (NSString*) _formEncodeString: (NSString*) string
    {
        NSString* encoded = (NSString*) CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
                                                                                (CFStringRef) string, NULL, CFSTR("!*'();:@&=+$,/?%#[]"), kCFStringEncodingUTF8);
        return [encoded autorelease];
    }
    
    - (void)viewWillAppear:(BOOL)animated
    {
    
        responseData = [[NSMutableData data] retain];
        ArrData = [NSMutableArray array];
        NSString *strURLRank=@"www.gmail.com";
        NSString *str=@"%2fblog?AccessID=member-10fd5cb877&Expires=1365850483&Signature=";
        NSString *str1=@"m%2F7hZu1y7Sa00NGLFKHYY%2FO3TB4%3D";
        NSString *stringWithoutSpaces = [NSString stringWithFormat:@"http://lsapi.seomoz.com/linkscape/url-metrics/%@",strURLRank];
        NSLog(@"%@",stringWithoutSpaces);
    
        stringWithoutSpaces=[NSString stringWithFormat:@"%@%@%@",stringWithoutSpaces,str,str1];
    
      //  stringWithoutSpaces=[stringWithoutSpaces stringByReplacingOccurrencesOfString:@" " withString:@"%20"];
       // stringWithoutSpaces = [stringWithoutSpaces stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
        NSLog(@"%@",stringWithoutSpaces);
    
        NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:stringWithoutSpaces]];
        NSLog(@"%@",request);
       [[NSURLConnection alloc] initWithRequest:request delegate:self];
    
        [super viewWillAppear:animated];
    }
    

    ……… Maulik Trambadiya Solution Finished……….

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

Sidebar

Related Questions

Can I figure out if a function has already been assigned to an event?
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Can anyone give me an example of how to return the following json simply
Can I register a .Net COM class with the SingleUse -flag? The reason I
Can't figure out how to do this in a pretty way : I have
Can i get the source code for a WAMP stack installer somewhere? Any help
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
can anyone tell me if it is possible to convert a dojo charting object
Can't work out a way to make an array of buttons in android. This
Can we put functions to determine the condition for our list comprehensions. Here is

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.