iphone - 来自使用 GData 的搜索查询的 YouTube UITableView

标签 iphone search youtube gdata

我正在尝试自定义表格 View 以根据搜索查询显示 youtube 视频的提要。我找到了这个代码 http://pastebin.com/vmV2c0HT它在表格 View 中显示 YouTube channel 的提要,它工作正常。但是,当修改 viewDidLoad 函数以搜索查询而不是用户提要时,我总是以空白 TableView 结束。

这是我的 viewDidLoad 函数:

- (void)viewDidLoad {

GDataServiceGoogleYouTube *service = [self youTubeService];

NSString *searchString = @"football";

NSString *uploadsID = kGDataYouTubeUserFeedIDUploads;

NSURL *feedURL = [GDataServiceGoogleYouTube youTubeURLForFeedID:nil];

GDataQueryYouTube* query = [GDataQueryYouTube  youTubeQueryWithFeedURL:feedURL];

[query setVideoQuery:searchString];

[query setMaxResults:5];

[service fetchFeedWithQuery:query delegate:self didFinishSelector:@selector(entryListFetchTicket:finishedWithFeed:)];

[super viewDidLoad];

}

任何帮助,将不胜感激。

--------------------- 解决方案 ----------

问题分为两部分:

-query fetch 调用中出现错误,将其更改为:

[服务 fetchFeedWithQuery:query delegate:self didFinishSelector:@selector(request:finishedWithFeed:error:)];

其他选择器方法未实现
  • 该服务不应跟随下一个链接,因为这样会获取所有提要

  • [_service setServiceShouldFollowNextLinks:NO];

    最佳答案

    您的cellForRowAtIndexPath 是什么?方法是什么样的?也许您对搜索查询的响应采用不同的格式,因此您之前的代码 cellForRowAtIndexPath不再适用。你可以尝试做一些NSLog如果需要,可以调用以查看信息的外观。

    关于iphone - 来自使用 GData 的搜索查询的 YouTube UITableView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3507967/

    相关文章:

    iPhone核心数据插入新对象

    iphone - 如何动态添加Section和TableView Cell

    iphone - UIScrollView 在 iPhone/iPad 上旋转时禁用滚动

    javascript - 使用 YouTube API 创建播放列表时如何更改标题和说明?

    jquery - YouTube 视频和图像在同一个 ColorBox 中?

    iphone - 开源 YouTube 风格的 UITableViewController

    iphone - iOS - 我可以修改 iPhone 中的实时属性列表文件吗?

    elasticsearch - 使用 NEST 针对某些索引模式搜索多个索引

    amazon-web-services - AWS Lex - 从用户问题中选择查询

    java - Google 搜索结果计数为 10000 个术语