RE: Newbie Error on Loading XML
RE: Newbie Error on Loading XML
- Subject: RE: Newbie Error on Loading XML
- From: Matt Keyes <email@hidden>
- Date: Mon, 11 Aug 2008 17:25:40 +0000
- Importance: Normal
That makes sense. I am new to Objective-C and the compiler did not complain with the missing arguments... lesson learned!
> CC: email@hidden
> From: email@hidden
> To: email@hidden
> Subject: Re: Newbie Error on Loading XML
> Date: Mon, 11 Aug 2008 11:24:07 -0600
>
> On Aug 11, 2008, at 11:16 AM, Matt Keyes wrote:
>
> > I am trying to load an XML file from the project, and here is what I
> > do:
> >
> > NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle]
> > pathForResource:@"MyXmlFile" ofType:@"Xml"]];
> > NSXMLDocument *xmlDoc = nil;
> >
> > @try {
> > xmlDoc = [[NSXMLDocument alloc] initWithContentsOfURL:url];
> > }
> [snip]
> > The error I receive is:
> >
> > "-[NSXMLDocument initWithContentsOfURL]: unrecognized selector sent
> > to instance 0x471100"
> >
> > I was able to load a NSData object from the XML file and I can
> > capture the file path in a string from the NSBundle resource path
> > and it is correct. I get this same error if I use the initWithData
> > function for the NSXMLDocument object.
> >
> > Any ideas?
>
> Yeah, NSXMLDocument doesn't respond to initWithContentsOfURL: or
> initWithData:. :)
>
> It *does*, however, respond to initWithContentsOfURL:options:error:
> and initWithData:options:error:.
>
> HTH.
_________________________________________________________________
Got Game? Win Prizes in the Windows Live Hotmail Mobile Summer Games Trivia Contest
http://www.gowindowslive.com/summergames?ocid=TXT_TAGHM_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden