2011-03-07 82 views
0

我正在玩谷歌的object-c API(Gdata)與youtube進行交互(在我的情況下),但我遇到了問題。我試圖搜索YouTube視頻與查詢類:iPhone Gdata-client Youtube查詢不起作用

NSURL *feedURL = [GDataServiceGoogleYouTube youTubeURLForFeedID:nil]; 
    GDataQueryYouTube *query = [GDataQueryYouTube youTubeQueryWithFeedURL:feedURL]; 


    [query setVideoQuery:@"\"Fred Flintstone\""]; 

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


    [ticket setShouldFollowNextLinks:NO]; 

但是,當我執行它,我有在CONSOL這個錯誤(回撥entryListFetchTicket甚至不叫)

2011-03-07 13:48:35.625 samsungTV[23061:207] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSInvocation invocationWithMethodSignature:]: method signature argument cannot be nil' * Call stack at first throw: ( 0 CoreFoundation
0x011ddbe9 exceptionPreprocess + 185 1 libobjc.A.dylib
0x013325c2 objc_exception_throw + 47 2 CoreFoundation
0x0114db09 +[NSInvocation invocationWithMethodSignature:] + 553 3 samsungTV
0x00018d34 +[GDataServiceBase invokeCallback:target:ticket:object:error:] + 83 4 samsungTV 0x000184a5 -[GDataServiceBase handleParsedObjectForFetcher:] + 840 5 Foundation
0x003709a6 __NSThreadPerformPerform + 251 6 CoreFoundation
0x011bf01f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION
+ 15 7 CoreFoundation 0x0111d28b __CFRunLoopDoSources0 + 571 8 CoreFoundation
0x0111c786 __CFRunLoopRun + 470 9
CoreFoundation
0x0111c240 CFRunLoopRunSpecific + 208 10 CoreFoundation
0x0111c161 CFRunLoopRunInMode + 97 11 GraphicsServices
0x018f9268 GSEventRunModal + 217 12 GraphicsServices
0x018f932d GSEventRun + 115 13 UIKit 0x0060042e UIApplicationMain + 1160 14 samsungTV
0x00002964 main + 102 15 samsungTV
0x000028f5 start + 53) terminate called after throwing an instance of 'NSException' Program received signal: 「SIGABRT」.

我不知道爲什麼...

但是,如果我使用的超視距雷達的手養活它的工作原理...

NSURL *feedURL; 
    feedURL = [GDataServiceGoogleYouTube youTubeURLForFeedID:kGDataYouTubeFeedIDMostPopular]; 


    ticket = [service fetchFeedWithURL:feedURL 
           delegate:self 
        didFinishSelector:@selector(entryListFetchTicket:finishedWithFeed:error:)]; 


    [ticket setShouldFollowNextLinks:NO] 

可以somedyoy給我一隻手嗎?

感謝

回答

0

你真的定義在類中的方法entryListFetchTicket:finishedWithFeed:您正在使用作爲委託對象?

0

GData提取的回調有三個參數,而不是兩個。第一個代碼片段缺少錯誤:在選擇器的末尾。

確保爲您的調試版本定義DEBUG = 1;圖書館將抓住這些問題。