NSString *urlStr = @"http://deeploveapple.blogspot.com/";
NSURL *url = [NSURL URLWithString:urlStr];
NSURLRequest *req = [NSURLRequest requestWithURL:url];
NSError *error = nil;
NSData *data = [NSURLConnection sendSynchronousRequest:req
returningResponse:nil error:&error];
if(data)
{
NSString *str = [[NSString alloc] initWithData:data
encoding:NSUTF8StringEncoding];
NSLog(@"str %@", str);
[str release];
}
else
{
NSLog(@"error %@", error);
}
沒有留言:
張貼留言