Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You problem is that you are not URLEncoding the data, but feeding it draw into the HTTP body. In this:</p> <pre><code>NSMutableData *body = [NSMutableData data]; NSString *postWerte = @"matr=XXXXX&amp;lang=1&amp;aktkw=1&amp;pressme=S T A R T"; [body appendData:[postWerte dataUsingEncoding:NSUTF8StringEncoding]]; </code></pre> <p>you need to URLEncode "S T A R T", and should bee really URLencoding every string that follows an equal sign. (UPDATE: so it works as is - my service is way picker and I must encode. YMMV!)</p> <p>EDIT: So try changing your code a bit, and if it still fails then please post the first line or two of the returned data:</p> <pre><code>NSData *returnData = [NSURLConnection sendSynchronousRequest: request returningResponse: nil error: nil]; assert(returnData); // you should be suppling an error pointer just in case but this will do for now // Log Response { NSString *response = [[NSString alloc] initWithBytes:[returnData bytes] length:[returnData length] encoding:NSASCIIStringEncoding]; NSLog(@"%@",[response substringToIndex:64]); // or a bit mor } NSXMLParser *parser = [[NSXMLParser alloc] initWithData: returnData]; assert(parser); // will be nil if anything has gone wrong, obviously in your real code put an if test [parser setDelegate:self]; // no affect for nil object [parser parse];// no affect for nil object </code></pre> <p>EDIT2:</p> <p>BTW, I missed this, and it may not make a difference, but the parser object has no property "delegate", you technically should be using the setter:</p> <pre><code>[parser setDelegate:self]; </code></pre> <p>Also, you did implement the following, right?</p> <pre><code>parserDidStartDocument: // which I assume you never see, right parser:validationErrorOccurred: parser:parseErrorOccurred: parserDidEndDocument: // you never see this either? </code></pre> <p>If parser is nil, dump the whole returned data as a UTF8 string (per the log code). Also, try looking for an error:</p> <pre><code>dispatch_async(dispatch_get_main_queue(), ^ { NSLog(@"PARSE ERROR: %@", [parser parseError]); } ); </code></pre>
 

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