【问题标题】:GTLQueryYouTube:queryForVideosListWithIdentifier:part: didn't do anything (Objective C )GTLQueryYouTube:queryForVideosListWithIdentifier:part: 什么都没做(目标 C)
【发布时间】:2014-12-27 11:49:39
【问题描述】:

我正在尝试使用 iOS-GTLYouTube 库来显示视频。到目前为止,这就是我所拥有的:

    //Get the youtube video list
    GTLServiceYouTube *service = [[GTLServiceYouTube alloc] init];
    // Set the APIKey
    service.APIKey = @"APIKey";

    GTLQueryYouTube *query = [GTLQueryYouTube queryForVideosListWithIdentifier:[vidListIds copy] part:@"id,snippet"];
    GTLServiceTicket *ticket = [   service executeQuery:query
                                   completionHandler:^(GTLServiceTicket *ticket, id object, NSError *error)
                                   {
                                   // This callback block is run when the fetch completes
                                       if (error == nil)
                                       {
                                           GTLYouTubeVideoListResponse *products = object;
                                           // iteration of items and subscript access to items.
                                           for (GTLYouTubeVideo *item in products)
                                           {
                                               GTLYouTubeVideoSnippetThumbnails *thumbnails = item.snippet.thumbnails;
                                               [thumbnailMutableList addObject:thumbnails];

                                               NSLog(@"Title: %@", item.snippet.title);
                                           }
                                       }
                                       else
                                       {
                                           NSLog(@"Error: %@", error.description);
                                       }
                                }];

我不知道为什么,但这段代码似乎没有做任何事情。既没有“标题:”日志也没有“错误”日志。我知道它是在一个单独的线程中完成的,所以它是异步工​​作的。但我已经等了 1-2 分钟,但仍然没有显示任何内容。有人可以在这里帮助我吗?谢谢。

【问题讨论】:

    标签: ios objective-c youtube-api youtube-data-api


    【解决方案1】:

    没关系。在 NSMutableString *vidListIds 我忘了附加一个逗号。傻我。不过感谢阅读。很抱歉误报。 :)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-12-29
      • 2014-07-07
      • 1970-01-01
      • 1970-01-01
      • 2017-11-23
      • 2013-02-07
      • 1970-01-01
      相关资源
      最近更新 更多