Note that there are some explanatory texts on larger screens.

plurals
  1. POConnection failed! Error - unsupported URL
    primarykey
    data
    text
    <p>I´m trying to make a login with name and password and pass it to a Url, but my connection fail and give me this error. What am I doing wrong?</p> <p>Connection failed! Error - unsupported URL proyecto.lavidapirata.es/main/validate_credentials/</p> <p>This is my method:</p> <pre><code>-(IBAction)login:(id)sender{ NSString *uName = userName.text; NSString *uPass = userPass.text; if([userName.text isEqualToString:@""] || [userPass.text isEqualToString:@""]) { greeting.text = @"Input Your Value"; //[userName resignFirstResponder]; //[userPass resignFirstResponder]; return; } NSString *post = [[NSString alloc] initWithFormat:@"uname=%@&amp;pwd=%@",uName,uPass]; NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion: YES]; NSString *postLength = [NSString stringWithFormat:@ "%d",[postData length]]; //Parte de la petición NSURL *url = [NSURL URLWithString:@"http://proyecto.lavidapirata.es"]; //proyecto.lavidapirata.es/main/validate_credentials NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url]; [theRequest setHTTPMethod:@"POST"]; [theRequest setValue:postLength forHTTPHeaderField:@"Content-Length"]; [theRequest setHTTPBody:postData]; NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self]; if(theConnection) { webData = [[NSMutableData data] retain]; } else { } //[userName resignFirstResponder]; //[userPass resignFirstResponder]; userName.text = nil; userPass.text = nil; } </code></pre> <p>that´s my console:</p> <p>2011-05-26 11:50:32.856 PruebaPush[764:207] -[NSCFString setLength:]: unrecognized selector sent to instance 0x4bac460 2011-05-26 11:50:32.861 PruebaPush[764:207] <strong>* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString setLength:]: unrecognized selector sent to instance 0x4bac460' *</strong> Call stack at first throw: ( 0 CoreFoundation 0x00dcb5a9 <strong>exceptionPreprocess + 185 1 libobjc.A.dylib 0x00f1f313 objc_exception_throw + 44 2 CoreFoundation 0x00dcd0bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187 3 CoreFoundation 0x00d3c966 __<em>forwarding</em></strong> + 966 4 CoreFoundation 0x00d3c522 _CF_forwarding_prep_0 + 50 5 PruebaPush 0x00003320 -[FirstViewController connection:didReceiveResponse:] + 111 6 Foundation 0x0005c3d0 -[NSURLConnection(NSURLConnectionReallyInternal) sendDidReceiveResponse:] + 143 7 Foundation 0x0005c306 _NSURLConnectionDidReceiveResponse + 146 8 CFNetwork 0x013730cc _ZN19URLConnectionClient29_clientSendDidReceiveResponseEP14_CFURLResponsePNS_26ClientConnectionEventQueueE + 46 9 CFNetwork 0x0143f7ec _ZN19URLConnectionClient26ClientConnectionEventQueue33processAllEventsAndConsumePayloadEP20XConnectionEventInfoI12XClientEvent18XClientEventParamsEl + 560 10 CFNetwork 0x0143f9cf _ZN19URLConnectionClient26ClientConnectionEventQueue33processAllEventsAndConsumePayloadEP20XConnectionEventInfoI12XClientEvent18XClientEventParamsEl + 1043 11 CFNetwork 0x0136ac84 _ZN19URLConnectionClient13processEventsEv + 100 12 CFNetwork 0x0136aad3 _ZN17MultiplexerSource7performEv + 251 13 CoreFoundation 0x00dac8ff <strong>CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION</strong> + 15 14 CoreFoundation 0x00d0a88b __CFRunLoopDoSources0 + 571 15 CoreFoundation 0x00d09d86 __CFRunLoopRun + 470 16 CoreFoundation 0x00d09840 CFRunLoopRunSpecific + 208 17 CoreFoundation 0x00d09761 CFRunLoopRunInMode + 97 18 GraphicsServices 0x017221c4 GSEventRunModal + 217 19 GraphicsServices 0x01722289 GSEventRun + 115 20 UIKit 0x002c9c93 UIApplicationMain + 1160 21 PruebaPush 0x00002778 main + 102 22 PruebaPush 0x00002709 start + 53 ) terminate called after throwing an instance of 'NSException'</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload