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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:17:00+00:00 2026-05-16T15:17:00+00:00

I’m trying to send some data to a PHP script online to submit online

  • 0

I’m trying to send some data to a PHP script online to submit online scores for my iOS application.

The script will require account credentials formatted with the proper escape characters for a HTTP request. It’s the setHTTPBody method which cashes the application:

        [text_field removeFromSuperview];
        text_field.text = @""; //Remove text so it doesn't show because the text field is still on top of the open gl view
        text_field.enabled = NO;
        NSMutableURLRequest * request=[NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"secret"] cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval:10.0];
        [request setHTTPMethod: @"POST"];
        [request setHTTPBody: [[NSString stringWithFormat:@"username=%@&password=%@&score=%i",[ogl_view->username stringByAddingPercentEscapesUsingEncoding:NSUnicodeStringEncoding],[text_field.text stringByAddingPercentEscapesUsingEncoding:NSUnicodeStringEncoding],ogl_view->score[0]] dataUsingEncoding:NSUnicodeStringEncoding]];  
        NSURLConnection * connection = [[NSURLConnection alloc] initWithRequest: request delegate:self];
        if (connection){
            received_data = [[NSMutableData data] retain];
            ogl_view->section = CURLING_PROCESS_CREDENTIALS;
        }else{
            ogl_view->section = CURLING_LOGIN_OR_REGISTER;
            UIAlertView *connection_alert = [[UIAlertView alloc] initWithTitle:@"Error" message: @"Can't connect to server" delegate:nil cancelButtonTitle:@"Close" otherButtonTitles: nil];
            [connection_alert show];
            [connection_alert release];
        }

I’ve found that it crashes at the point that the setHTTPBody method is called. Does anyone know why?

Thank you for any answer.

Edit: Here’s the crash log:

    2010-09-02 19:02:30.291 iPhone Monkey Curling[431:207] -[DOMText stringByAddingPercentEscapesUsingEncoding:]: unrecognized selector sent to instance 0x5c97ce0
    2010-09-02 19:02:30.293 iPhone Monkey Curling[431:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[DOMText stringByAddingPercentEscapesUsingEncoding:]: unrecognized selector sent to instance 0x5c97ce0'
    *** Call stack at first throw:
    (
        0   CoreFoundation                      0x02531919 __exceptionPreprocess + 185
        1   libobjc.A.dylib                     0x0267f5de objc_exception_throw + 47
        2   CoreFoundation                      0x0253342b -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
        3   CoreFoundation                      0x024a3116 ___forwarding___ + 966
        4   CoreFoundation                      0x024a2cd2 _CF_forwarding_prep_0 + 50
        5   iPhone Monkey Curling               0x00004338 -[PasswordFieldDelegate textFieldShouldReturn:] + 450
        6   UIKit                               0x00699358 -[UIKeyboardImpl callShouldInsertText:] + 148
        7   UIKit                               0x05f29c86 -[UIKeyboardImplAccessibility(SafeCategory) callShouldInsertText:] + 70
        8   UIKit                               0x006a0693 -[UIKeyboardImpl addInputString:fromVariantKey:] + 107
        9   UIKit                               0x006a2957 -[UIKeyboardImpl handleKeyEvent:] + 1723
        10  UIKit                               0x007c31c0 -[UIKeyboardLayoutStar sendStringAction:forKey:] + 684
        11  UIKit                               0x007c79ba -[UIKeyboardLayoutStar touchUp:] + 2556
        12  UIKit                               0x006b99a3 -[UIKeyboardLayout touchesEnded:withEvent:] + 550
        13  UIKit                               0x0058a2ff -[UIWindow _sendTouchesForEvent:] + 567
        14  UIKit                               0x0056c1ec -[UIApplication sendEvent:] + 447
        15  UIKit                               0x00570ac4 _UIApplicationHandleEvent + 7495
        16  GraphicsServices                    0x02d97afa PurpleEventCallback + 1578
        17  CoreFoundation                      0x02512dc4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
        18  CoreFoundation                      0x02473737 __CFRunLoopDoSource1 + 215
        19  CoreFoundation                      0x024709c3 __CFRunLoopRun + 979
        20  CoreFoundation                      0x02470280 CFRunLoopRunSpecific + 208
        21  CoreFoundation                      0x024701a1 CFRunLoopRunInMode + 97
        22  GraphicsServices                    0x02d962c8 GSEventRunModal + 217
        23  GraphicsServices                    0x02d9638d GSEventRun + 115
        24  UIKit                               0x00574b58 UIApplicationMain + 1160
        25  iPhone Monkey Curling               0x00002388 main + 102
        26  iPhone Monkey Curling               0x00002319 start + 53
    )
  • 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-05-16T15:17:01+00:00Added an answer on May 16, 2026 at 3:17 pm

    -setHTTPBody accepts NSData, not an NSString. You’ll need to convert your NSString to NSData before setting it.

    Luckily, NSString has a dataUsingEncoding: method to make it super easy.

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

Sidebar

Ask A Question

Stats

  • Questions 533k
  • Answers 533k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I would certainly recommend using well tested libraries if possible.… May 17, 2026 at 12:22 am
  • Editorial Team
    Editorial Team added an answer You can't have a production server with jumping time. Google… May 17, 2026 at 12:22 am
  • Editorial Team
    Editorial Team added an answer Do not sprinkle Data Access logic in your models. Instead… May 17, 2026 at 12:22 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
I have just tried to save a simple *.rtf file with some websites and
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.