я получаю следующую ошибку, когда запускаю программу, указанную ниже
Ошибка: Ошибка Domain = NSURLErrorDomain Code = -1000 "bad URL" UserInfo = 0x5948b80 {NSUnderlyingError = 0x5948ac0 "bad URL", NSLocalizedDescription =плохой URL}
Ват мне нужно сделать, пожалуйста, предложите мне
спасибо ...
код указан ниже
@implementation WebSampleViewController
- (void)viewDidLoad
{
[super viewDidLoad];
dataWebService = [[NSMutableData data] retain];
NSMutableURLRequest *request = [[NSMutableURLRequest requestWithURL:[NSURL URLWithString:@" http://www.googleapis.com/customsearch"]] retain];
NSURLConnection *myConnection = [NSURLConnection connectionWithRequest:request delegate:self];
[myConnection start];
[super viewDidLoad];
}
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
{
[dataWebService setLength:0];
}
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
[dataWebService appendData:data];
}
- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
NSString *responseString = [[NSString alloc] initWithData:dataWebService encoding:NSUTF8StringEncoding];
NSLog(@"Response: %@",responseString);
[responseString release];
[dataWebService release];
}
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
{
NSLog(@"Error during connection: %@", [error description]);
}