私は2つの検索エンジンで同時検索を実装する必要があります。 (NSStringの)テキストと * - (無効)searchYahoo:: - (無効)searchYoutube *:私は2つの機能があります(NSStringの)テキストNSURLConnectionの問題sendSynchronousRequest
(void) searchYahoo:(NSString *)text{
NSString *urlString = [NSString stringWithFormat:@"http://search.yahooapis.com/WebSearchService/V1/webSearch?appid=%@&output=json&query=%@&results=30", YahooAppId, text];
NSLog(@"URL zaprosa: %@",urlString);
//Create NSURL string from formatted string
NSURL *url = [NSURL URLWithString:urlString];
NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url];
NSURLConnection *connection = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
if (connection)
{
NSLog(@"Data will be received from URL: %@", url);
}
else
{
NSLog(@"Data couldn't be received from URL: %@", url);
}}
機能-searchYoutubeを:あります上記と同様です。しかし、これら2つの関数でクエリを呼び出すと、私は参照してください
2011-06-26 14:06:27.523 TrueSearcher[5373:207] URL query: http://gdata.youtube.com/feeds/api/videos?q=os&start-index=1&max-results=30&alt=jsonc&v=2
2011-06-26 14:06:27.874 TrueSearcher[5373:207] Data will be received from URL: http://gdata.youtube.com/feeds/api/videos?q=os&start-index=1&max-results=30&alt=jsonc&v=2
2011-06-26 14:06:27.875 TrueSearcher[5373:207] URL query: http://search.yahooapis.com/WebSearchService/V1/webSearch?appid=jwGJkT32&output=json&query=os&results=30
2011-06-26 14:06:29.010 TrueSearcher[5373:207] Data will be received from URL: http://search.yahooapis.com/WebSearchService/V1/webSearch?appid=jwGJkT32&output=json&query=os&results=30
それだけです。私はデータを受け取ることができません。私は間違って何をしていますか?