Nsxmlparser Error Code 4
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and
Error Domain=nsxmlparsererrordomain Code=111
policies of this site About Us Learn more about Stack Overflow the nsxmlparsererrordomain error 5 company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up NSXMLParser gives error code 4 only sometimes, when the NSData input is always the same up vote 1 down vote favorite I am using the class XMLReader to parse some XML from a URL. The XML is successfully parsed sometimes, and sometimes I get: Error Domain=NSXMLParserErrorDomain Code=4 "The operation couldn’t be completed. (NSXMLParserErrorDomain error 4.)" The parse is usually successful the first time I run it, after changing something, and it fails after that until I change something else. For example, in the code below, I tried commenting out the [parser release] line, and it parsed successfully. Then I ran it again and back to error code 4. I log the same input data every time, success or fail. Any ideas what is going wrong here? I can paste in more code if that would help, but I have isolated the error to be within the NSXMLParser parse method (called in the code below), because it always receives the same data. Thanks! edit: I know that error code 4 is an empty document error. But I know my NSData is not empty. So there is something else happening here - (NSDictionary *)objectWithData:(NSData *)data { //data always makes it here, the same data gets logged regardless of parse success //NSLog(@"%@",data); // Clear out any old data [dictionaryStack release]; [textInProgress release]; dictionaryStack = [[NSMutableArray alloc] init]; textInProgress = [[NSMutableString alloc] init]; // Initialize the stack with a fresh dicti
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of http://stackoverflow.com/questions/10856424/nsxmlparser-gives-error-code-4-only-sometimes-when-the-nsdata-input-is-always-t 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up NSXMLParser error code 4 (Document is empty) and (parser: didStartElement: namespaceURI: qualifiedName: attributes: ) is not being called up vote 0 down vote favorite I'm trying to parse a list of Projects info from an xml http://stackoverflow.com/questions/27523885/nsxmlparser-error-code-4-document-is-empty-and-parser-didstartelement-names file from a web api. The beginning of the file looks like:
here for a quick overview of the site Help Center Detailed answers to any http://stackoverflow.com/questions/20722191/the-operation-couldn-t-be-completed-nsxmlparsererrordomain-error-111 questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow nsxmlparser error is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up “The operation couldn’t be completed. (NSXMLParserErrorDomain error 111.)” up vote 1 down vote favorite I am trying to parse an XML string in Xcode. It parse the string successfully, but after nsxmlparser error code it gives error. Here is the xml String, parsing code and error message. please guide me. Thank you all in advance. XML String.