根据URL读取网页源码

	NSURL *url = [NSURL URLWithString:@"http://www.google.com.hk/"];

	NSStringEncoding enc = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000);

	

	NSError *error;

	NSString *content = [NSString stringWithContentsOfURL:url

												 encoding:enc

													error:&error];

	NSLog(@"content = %@",content);

你可能感兴趣的:(url)