Skip to content
This repository has been archived by the owner on Sep 16, 2022. It is now read-only.

Missing initWithContentsOfUrl #17

Closed
GoogleCodeExporter opened this issue Apr 21, 2015 · 0 comments
Closed

Missing initWithContentsOfUrl #17

GoogleCodeExporter opened this issue Apr 21, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
I used this library because I had code that used NSXMLDocument that I
wanted to put on the iPhone.  I was able to build but my app crashed
because the GDataXMLDocument did not accept the initWithContentsOfUrl
selector which I use in various places in my code.

What is the expected output? What do you see instead?
I expected this to work exactly as a replacement for NSXMLDocument, instead
this method was missing.  Though this method was trivial to implement it
was still kind of annoying and is a simple fix.

Please use labels and text to provide additional information.

I ended up adding it myself, code follows.

- (id)initWithContentsOfURL:(NSURL *)url options:(unsigned int)mask
error:(NSError **)error {

    NSString *contentString = [NSString stringWithContentsOfURL:url
encoding:NSASCIIStringEncoding error:error];
    NSData *data = [contentString dataUsingEncoding:NSUTF8StringEncoding];
    GDataXMLDocument *doc = [self initWithData:data options:mask error:error];
    return doc;
}

Original issue reported on code.google.com by travispo...@gmail.com on 10 Feb 2009 at 3:31

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants