这个有点麻烦....
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
//1
NSString *urlString = @"http://zaphod_beeblebrox.pythonanywhere.com/";
//2
NSURL *url = [NSURL URLWithString:urlString];
//3
NSURLRequest *request = [NSURLRequest requestWithURL:url];
//4
NSOperationQueue *queue = [[NSOperationQueue alloc] init];
//5
[NSURLConnection sendAsynchronousRequest:request queue:queue
completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {
if ([data length] > 0 && error == nil) (UIWebView)
else if ((error != nil) NSLog(@"Error: %@", error))}];
}@end
如果出现问题,我似乎无法弄清楚是什么原因造成的。我已经用谷歌搜索了这个废话,并一遍又一遍地检查了我的代码,但我似乎无法弄清楚这一点!
请帮忙。