views:

45

answers:

0

Hi all,

I'm facing a problem in which NSXMLParser is parsing the data provided to it by an XML file on localhost on simulator but not on iPhone.

I'm using the following code:

NSURL *url = [[NSURL alloc] initWithString:@"http://192.168.10.2/justmeans/trunk/apimediadata?m=newsfeed&offset=0&limit=20"];

NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithContentsOfURL:url];

//Initialize the delegate.
XMLParser *parser = [[XMLParser alloc] initXMLParser];

//Set delegate
[xmlParser setDelegate:parser];

//Start parsing the XML file.
BOOL success = [xmlParser parse];

if(success)
    NSLog(@"No Errors");
else
    NSLog(@"Error Error Error!!!"); 

It's taking much time initialising with URL [might be because it loads the entire file in memory]. And after calling [xmlParser parse], it's returning success = No.

This' really urgent.

Can anybody please help.

Thanx in advance.