我正在尝试自定义表格视图以根据搜索查询显示 YouTube 视频的提要。我找到了这段代码http://pastebin.com/vmV2c0HT http://pastebin.com/vmV2c0HT它在表格视图中显示 YouTube 频道的提要,效果很好。但是,当修改 viewDidLoad 函数以搜索查询而不是用户提要时,我总是得到一个空白的表视图。
这是我的 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];
}
任何帮助,将不胜感激。
- - - - - - - - - - - 解决方案 - - - - - - - - - - -
问题分为两部分:
- 查询提取调用出现错误,将其更改为:
[服务 fetchFeedWithQuery:查询委托:self didFinishSelector:@selector(request:finishedWithFeed:error:)];
另一个选择器方法没有实现
- 该服务不应遵循下一个链接,因为这样所有的提要都会被获取
[_service setServiceShouldFollowNextLinks:NO];
你的什么cellForRowAtIndexPath
方法是什么样的?也许您获得的搜索查询响应采用不同的格式,因此您之前的代码cellForRowAtIndexPath
不再适用。你可以尝试做一些NSLog
如果您愿意,可以致电查看信息。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)