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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:55:34+00:00 2026-06-02T20:55:34+00:00

I have made this so far. It’s code that will make a json String

  • 0

I have made this so far. It’s code that will make a json String request with an http Header. When i run this code i get no errors. But i get a Expression result unused warning. I should get a response from the web service after sending this http header.

code:

- (void)viewDidLoad
{
    [super viewDidLoad];

    NSString *nid = @"";
    NSString *vocab = @"";
    NSString *inturl = @"testoverview";
    NSString *mail = @"chh@fbr.dk";
    NSString *md5pw = @"4d57e7ef1b7c3f431aca424764e9d786";

    NSDictionary *jsonDictionary = [NSDictionary dictionaryWithObjectsAndKeys:
                                    nid, @"nid", 
                                    vocab, @"vocab",
                                    inturl, @"inturl",
                                    mail, @"mail",
                                    md5pw, @"md5pw",nil];
    NSError *error;
    NSData *jsonData = [NSJSONSerialization dataWithJSONObject:jsonDictionary options:NSJSONWritingPrettyPrinted error:&error];
    NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];

    if (!jsonData) {
        NSLog(@"Got an error; %@", error);
            } else if(jsonData) {

                NSString *url = @"http://www.taenk.dk/services/mobile";
                NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy:NSURLCacheStorageAllowed timeoutInterval:30.0];

                [request setValue:jsonString forHTTPHeaderField:@"X-FBR-App"];
                [[NSURLConnection alloc] initWithRequest:request delegate:self]; <-- this line triggers the warning: "Expression result unused"

                NSLog(@"jsonString %@", jsonString);

            }

Can anybody clarify 2 things for me:

  1. Does this trigger a response as soon as the request to the web service?
  2. If yes, how do i print this result out?
  • 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-02T20:55:36+00:00Added an answer on June 2, 2026 at 8:55 pm

    You need to assign the result to a variable like

    NSURLConnection *con = [[NSURLConnection alloc] initWithRequest:...
    

    for later use (e.g. [con cancel];)

    Then you should at least implement the delegate method connection:didFailWithError:. In the class reference I don’t see the connection:didFinishLoading... anymore. Can you use the sendSynchronousRequest:returningResponse:error: instead, then you’ll have the result, be it positive or negative.

    This is how I retrieved the data (this version is without ARC):

    - (void) connection :(NSURLConnection *)conn didReceiveData :(NSData *)data {
        NSString *msg = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
        [self checkAutoMailReply:msg];
        [msg release];
    }
    

    msg contains the pure response data, no header or such.

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

Sidebar

Related Questions

Hi have made this function which is made to replicate an error that I
I have made this code to open a database(created in SQLite browser) stored in
I have made this webpage, you can check it out here http://www.bettingtowin.net/webcam.html I have
i have made a simple php contact form following this tutorial: http://www.catswhocode.com/blog/how-to-create-a-built-in-contact-form-for-your-wordpress-theme The big
i am not the best at php but have made it this far. what
im learning wpf for the first time, i have made this far private void
i have made a template that look like this : <ControlTemplate x:Key=onoffValue TargetType={x:Type Control}>
I know other posts have been made regarding this, but so far the answers
I have made this centered navigation bar, and I wanted to add a :active
OK, I was just fooling around in my spare time and have made this

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.