On 28 Apr '08, at 6:42 PM, Lorenzo Thurman wrote:
NSString* urlString = [str stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
You shouldn't need this step if 'str' is already a string representation of the URL. For example, it would convert a "?" or "#" in the URL into a percent-escaped sequence.
NSXMLParser* locationData = [[[XMLParser alloc] initWithContentsOfURL:[NSURLURLWithString:urlString]] autorelease];
Have you tried loading the data first, and then parsing it? Does the data look reasonable, i.e. can you convert it to an NSString using the expected encoding?
Also, are you sure the XML is valid? XML parsers are very picky, by design (unlike Web browsers), and will fail if there are any syntax errors.
If your app doesn't need to run on pre-10.4 systems, you could consider using NSXMLDocument instead, which is a newer and more powerful API. It lets you use XPath and XQuery to search through the DOM, and it integrates libTidy, which will clean up invalid XML and HTML for you.
—Jens
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]