开发者

How to get content from URL asynchronously?

开发者 https://www.devze.com 2023-01-17 22:22 出处:网络
I\'m trying here to create 开发者_开发知识库NSXMLParser from content of URL, it work perfectly well but is there way I can make URL content to be received asynchronously and later create NSXMLParser?

I'm trying here to create 开发者_开发知识库NSXMLParser from content of URL, it work perfectly well but is there way I can make URL content to be received asynchronously and later create NSXMLParser?

NSURL *url = [[NSURL alloc] initWithString: @"http://www.Xmlfile.com"];
NSXMLParser *parser = [[NSXMLParser alloc] initWithContentsOfURL:url];
[url release];


Use NSURLConnection to fetch the data asynchronously into an NSData, then use initWithData instead of initWithContentsOfURL.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号