iPhone Gdata-client Youtube query doesn't work - iphone

I'm playing with the object-c API (Gdata) of google to interact with youtube (in my case) but i'm running into a problem. I'm trying to search a youtube video with the query class:
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];
But when i execute it i have this error in the consol (the call back entryListFetchTicket is not even called)
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”.
I have no idea why...
But in the othr hand if i uses feed it works...
NSURL *feedURL;
feedURL = [GDataServiceGoogleYouTube youTubeURLForFeedID:kGDataYouTubeFeedIDMostPopular];
ticket = [service fetchFeedWithURL:feedURL
delegate:self
didFinishSelector:#selector(entryListFetchTicket:finishedWithFeed:error:)];
[ticket setShouldFollowNextLinks:NO]
Can somebdoy give me a hand ?
Thanks

Do you actually define a method entryListFetchTicket:finishedWithFeed: in your class that you are using as the delegate object?

The callbacks for GData fetches have three parameters, not two. The first code snippet is missing the error: at the end of the selector.
Be sure to define DEBUG=1 for your debug builds; the library will catch such issues.

Related

iPhone app crashes with exception

I have an iPhone app which uses iAd...The app crashes sometime with the following message;
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFType bannerViewDidLoadAd:]: unrecognized selector sent to instance 0x621cd10'
*** Call stack at first throw:
(
0 CoreFoundation 0x00e015a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x00f55313 objc_exception_throw + 44
2 CoreFoundation 0x00e030bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x00d72966 ___forwarding___ + 966
4 CoreFoundation 0x00d72522 _CF_forwarding_prep_0 + 50
5 CoreFoundation 0x00d71c7d __invoking___ + 29
6 CoreFoundation 0x00d71b51 -[NSInvocation invoke] + 145
7 CoreFoundation 0x00d72a04 ___forwarding___ + 1124
8 CoreFoundation 0x00d72522 _CF_forwarding_prep_0 + 50
9 iAd 0x00[Switching to process 8860 thread 0x207]
0139f9 -[ADDistributedMessagingCenter messagePort:receivedMessage:withData:] + 251
10 iAd 0x00014012 ADMessagePortCallBack + 75
11 CoreFoundation 0x00db8f4c __CFMessagePortPerform + 396
12 CoreFoundation 0x00de2944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
13 CoreFoundation 0x00d42cf7 __CFRunLoopDoSource1 + 215
14 CoreFoundation 0x00d3ff83 __CFRunLoopRun + 979
15 CoreFoundation 0x00d3f840 CFRunLoopRunSpecific + 208
16 CoreFoundation 0x00d3f761 CFRunLoopRunInMode + 97
17 GraphicsServices 0x033fe1c4 GSEventRunModal + 217
18 GraphicsServices 0x033fe289 GSEventRun + 115
19 UIKit 0x002ffc93 UIApplicationMain + 1160
20 MyApp 0x00001ba8 main + 102
21 MyApp 0x00001b39 start + 53
)
terminate called after throwing an instance of 'NSException'
Below is my NSZombie message;
# Category Event Type RefCt Timestamp Address Size Responsible Library Responsible Caller
77 DetailController Zombie -1 04:01.914.883 0x5768bd0 0 iAd -[ADDistributedMessagingCenter messagePort:receivedMessage:withData:]
Also bannerViewDidLoadAd code;
- (void)bannerViewDidLoadAd:(ADBannerView *)banner
{
if (!bannerIsVisible)
{
[UIView beginAnimations:#"animateAdBannerOn" context:NULL];
// assumes the banner view is offset -50 pixels so that it is not visible.
banner.frame = CGRectOffset(banner.frame, 0, -50); // if the banner is on top of the screen use 50
[UIView commitAnimations];
bannerIsVisible = YES;
}
}
Please help me fix the same. Thank you.
Basically you're calling bannerViewDidLoadAd: with the wrong object type. It appears that you're using some sort of dispatch mechanism to do this. Either you specified the wrong object when you set up the dispatch request for that method, or you failed to retain the object and it's been deleted and replaced with a NSType object.
So find where bannerViewDidLoadAd: is mentioned in your code and make sure the object being used with it is correct and is appropriately retained.
bannerViewDidLoad is getting called after it's delegate is released, hence the zombie message.
I would guess that this means your ad isn't being released and is sticking around after your controller is going away.

App Crash While hitting web Services

I have a table view in which Iam selecting a row of the table view and then it hits the web services, retrieves data and then displayed. Now this is my error log Iam getting.
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-
[__NSCFData setDownloadedLogoImage:]: unrecognized selector sent to instance 0x806cf90'
*** Call stack at first throw:
(
0 CoreFoundation 0x02abdb99 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x02c0d40e objc_exception_throw + 47
2 CoreFoundation 0x02abf6ab -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x02a2f2b6 ___forwarding___ + 966
4 CoreFoundation 0x02a2ee72 _CF_forwarding_prep_0 + 50
5 FlightSearch 0x000401ef -[AirlineNames connectionDidFinishImage:] + 168
6 FlightSearch 0x0002f535 -[SAHttpManager connectionDidFinishLoading:] + 195
7 Foundation 0x001acb96 -[NSURLConnection(NSURLConnectionReallyInternal) sendDidFinishLoading] + 108
8 Foundation 0x001acaef _NSURLConnectionDidFinishLoading + 133
9 CFNetwork 0x0307172f _ZN19URLConnectionClient23_clientDidFinishLoadingEPNS_26ClientConnectionEventQueueE + 285
10 CFNetwork 0x0313cfcf _ZN19URLConnectionClient26ClientConnectionEventQueue33processAllEventsAndConsumePayloadEP20XConnectionEventInfoI12XClientEvent18XClientEventParamsEl + 389
11 CFNetwork 0x03066968 _ZN19URLConnectionClient13processEventsEv + 100
12 CFNetwork 0x030667e5 _ZN17MultiplexerSource7performEv + 251
13 CoreFoundation 0x02a9efaf __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
14 CoreFoundation 0x029fd39b __CFRunLoopDoSources0 + 571
15 CoreFoundation 0x029fc896 __CFRunLoopRun + 470
16 CoreFoundation 0x029fc350 CFRunLoopRunSpecific + 208
17 CoreFoundation 0x029fc271 CFRunLoopRunInMode + 97
18 GraphicsServices 0x032b000c GSEventRunModal + 217
19 GraphicsServices 0x032b00d1 GSEventRun + 115
20 UIKit 0x00419af2 UIApplicationMain + 1160
21 FlightSearch 0x00001e86 main + 84
22 FlightSearch 0x00001e29 start + 53
23 ??? 0x00000001 0x0 + 1
)
terminate called after throwing an instance of 'NSException'
Kindly suggest me what should i do.
You're sending the message setDownloadedLogoImage: to an NSData object, which has no idea what to do with it! One of two things has happened:
1) You have not retained something. Take a look at whatever object you expect to call setDownloadedLogoImage on and find out where you create it - you should probably be retaining it there ;)
2) (less likely) Your code is just wrong! Add it to your question and we can take a look.

How to understand string or array in the web service answer

I get to array value from web service. This array is 1 or more than 1-element array.If tempArra is 1 dimesional array and then If I want to transfer the data in the array to another array(garbageDatesFor01) Then I get the error
EDIT: returning to the web service responses in 2 ways
RESPONSE 1
(
(
"2011-08-03",
"2011-08-17"
)
)
OR
RESPONSE 2
2011-08-04
NSArray *garbageDatesFor01=[[NSArray alloc] initWithArray:tempArr];
2011-08-26 18:43:35.689 AOK[1846:207] -[NSCFString count]: unrecognized selector sent to instance 0x990d8f0
2011-08-26 18:43:35.691 AOK[1846:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString count]: unrecognized selector sent to instance 0x990d8f0'
*** Call stack at first throw:
(
0 CoreFoundation 0x015d25a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x01726313 objc_exception_throw + 44
2 CoreFoundation 0x015d40bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x01543966 ___forwarding___ + 966
4 CoreFoundation 0x01543522 _CF_forwarding_prep_0 + 50
5 CoreFoundation 0x01535d87 -[NSArray initWithArray:] + 39
6 TwenteMilieu 0x0001323a -[ForgottenContainerT1 connectionDidFinishLoading:] + 3750
7 Foundation 0x00113112 -[NSURLConnection(NSURLConnectionReallyInternal) sendDidFinishLoading] + 108
8 Foundation 0x0011306b _NSURLConnectionDidFinishLoading + 133
9 CFNetwork 0x0117148e _ZN19URLConnectionClient23_clientDidFinishLoadingEPNS_26ClientConnectionEventQueueE + 220
10 CFNetwork 0x0123c6e1 _ZN19URLConnectionClient26ClientConnectionEventQueue33processAllEventsAndConsumePayloadEP20XConnectionEventInfoI12XClientEvent18XClientEventParamsEl + 293
11 CFNetwork 0x01167c80 _ZN19URLConnectionClient13processEventsEv + 100
12 CFNetwork 0x01167acf _ZN17MultiplexerSource7performEv + 251
13 CoreFoundation 0x015b38ff __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
14 CoreFoundation 0x0151188b __CFRunLoopDoSources0 + 571
15 CoreFoundation 0x01510d86 __CFRunLoopRun + 470
16 CoreFoundation 0x01510840 CFRunLoopRunSpecific + 208
17 CoreFoundation 0x01510761 CFRunLoopRunInMode + 97
18 GraphicsServices 0x01b411c4 GSEventRunModal + 217
19 GraphicsServices 0x01b41289 GSEventRun + 115
20 UIKit 0x0037fc93 UIApplicationMain + 1160
21 TwenteMilieu 0x00002644 main + 102
22 TwenteMilieu 0x000025d5 start + 53
)
terminate called after throwing an instance of 'NSException'
Current language: auto; currently objective-c
The important line is :
2011-08-26 18:43:35.689 TwenteMilieu[1846:207] -[NSCFString count]: unrecognized selector sent to instance 0x990d8f0
It means you are calling count on a string. The object you think is an array is actually a string.
From looking at your code, tempArr could be either an array or a string. Try this:
if ([tempArr isKindOfClass:[NSArray class]])
{
// Handle array case
}
else if ([tempArr isKindOfClass:[NSString class]])
{
// Handle string case
}
It's probably a good idea to change the name of tempArr to something else, like tempResponse or similar.

Why does this error occur?

i am parsing the data from web service.After parsing the few records it gives this error.Somebody please the tell me what the reason behind this error?
[NSXMLParser length]: unrecognized selector sent to instance 0x6e6d340
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSXMLParser length]: unrecognized selector sent to instance 0x6e6d340'
*** Call stack at first throw:
(
0 CoreFoundation 0x026c4919 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x028125de objc_exception_throw + 47
2 CoreFoundation 0x026c642b -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x02636116 ___forwarding___ + 966
4 CoreFoundation 0x02635cd2 _CF_forwarding_prep_0 + 50
5 Foundation 0x001053e9 -[NSXMLParser parse] + 104
6 SexOffenders 0x00009c30 -[UserProfileVC connectionDidFinishLoading:] + 565
7 Foundation 0x0006e666 -[NSURLConnection(NSURLConnectionReallyInternal) sendDidFinishLoading] + 108
8 Foundation 0x0006e5bf _NSURLConnectionDidFinishLoading + 133
9 CFNetwork 0x02c569f1 _ZN19URLConnectionClient23_clientDidFinishLoadingEPNS_26ClientConnectionEventQueueE + 285
10 CFNetwork 0x02d1fc72 _ZN19URLConnectionClient26ClientConnectionEventQueue33processAllEventsAndConsumePayloadEP20XConnectionEventInfoI12XClientEvent18XClientEventParamsEl + 402
11 CFNetwork 0x02d200ea _ZN19URLConnectionClient26ClientConnectionEventQueue33processAllEventsAndConsumePayloadEP20XConnectionEventInfoI12XClientEvent18XClientEventParamsEl + 1546
12 CFNetwork 0x02d200ea _ZN19URLConnectionClient26ClientConnectionEventQueue33processAllEventsAndConsumePayloadEP20XConnectionEventInfoI12XClientEvent18XClientEventParamsEl + 1546
13 CFNetwork 0x02c4bdfe _ZN19URLConnectionClient13processEventsEv + 100
14 CFNetwork 0x02c4bc95 _ZN17MultiplexerSource7performEv + 247
15 CoreFoundation 0x026a5d7f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
16 CoreFoundation 0x026041dd __CFRunLoopDoSources0 + 333
17 CoreFoundation 0x026037c6 __CFRunLoopRun + 470
18 CoreFoundation 0x02603280 CFRunLoopRunSpecific + 208
19 CoreFoundation 0x026031a1 CFRunLoopRunInMode + 97
20 GraphicsServices 0x02f292c8 GSEventRunModal + 217
21 GraphicsServices 0x02f2938d GSEventRun + 115
22 UIKit 0x002dab58 UIApplicationMain + 1160
23 SexOffenders 0x00002198 main + 102
24 SexOffenders 0x00002129 start + 53
)
terminate called after throwing an instance of 'NSException'
'-[NSXMLParser length]: unrecognized selector sent to instance 0x6e6d340
this shows you are calling a function which is not a member function of NSXMLParser class.
actually in your code you are calling any method which can not be invoke on the obeject of NSXMLParser class.
chechk by debugging pointer.
I just suffered from this same issue. For me the problem was caused by this line of code:
operation.responseSerializer = [AFXMLParserResponseSerializer serializer];
This serialised the responseObject I was passing into the parser to XML but the parser expects an NSData object. Simply getting rid of that line solved the problem.
I also faced the similar problem.
Fixed by changing my line
self.xmlParser = [[NSXMLParser alloc] initWithData:data];
to
self.xmlParser = (NSXMLParser *)responseObject;
I found my solution from this blog
Raywanderlick Blog
Explanation for Error
This configuration of [AFXMLParserResponseSerializer serializer] already return an initialized object and I was initializing it again using already initialized parser by considering it data object.
Commenting following line didn't work for me as suggested by #Hodson answer above and it doesn't make sense as this is default configuration of AFTNetworking library.
operation.responseSerializer = [AFXMLParserResponseSerializer serializer];

Terminating app due to uncaught exception 'NSInvalidArgumentException'

I am using ShareKit to allow the user to share their score on Twitter and Facebook in my iPhone app. However, it seems to crash shortly after sharing on either service. I get an console message which says:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFString rangeOfString:options:range:locale:]: nil argument'
*** Call stack at first throw:
(
0 CoreFoundation 0x026d6919 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x028245de objc_exception_throw + 47
2 CoreFoundation 0x0268f078 +[NSException raise:format:arguments:] + 136
3 CoreFoundation 0x0268efea +[NSException raise:format:] + 58
4 Foundation 0x0008f97b -[NSString rangeOfString:options:range:locale:] + 424
5 Foundation 0x0009de16 -[NSString rangeOfString:] + 104
6 iPhone Typer 0x00030220 -[SHKOAuthView webView:shouldStartLoadWithRequest:navigationType:] + 151
7 UIKit 0x004bb456 -[UIWebView webView:decidePolicyForNavigationAction:request:frame:decisionListener:] + 458
8 CoreFoundation 0x0264742d __invoking___ + 29
9 CoreFoundation 0x02647301 -[NSInvocation invoke] + 145
10 WebCore 0x030940f0 _ZL20HandleDelegateSourcePv + 64
11 CoreFoundation 0x026b7d7f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
12 CoreFoundation 0x026162cb __CFRunLoopDoSources0 + 571
13 CoreFoundation 0x026157c6 __CFRunLoopRun + 470
14 CoreFoundation 0x02615280 CFRunLoopRunSpecific + 208
15 CoreFoundation 0x026151a1 CFRunLoopRunInMode + 97
16 GraphicsServices 0x02e5e2c8 GSEventRunModal + 217
17 GraphicsServices 0x02e5e38d GSEventRun + 115
18 UIKit 0x00339b58 UIApplicationMain + 1160
19 iPhone Typer 0x00002894 main + 102
20 iPhone Typer 0x00002825 start + 53
)
terminate called after throwing an instance of 'NSException'
How would I fix this? Thanks.
Set a breakpoint on objc_exception_throw, then build the app for debug, run the app with breakpoints on and cause the crash again, then go up the stack to the relevant code.
Something inside SHKOAuthView webView:shouldStartLoadWithRequest:navigationType: is passing a nil argument to NSString rangeOfString. When you know what is passing the nil, it may be obvious what the problem is - failing that update your question with the relevant code and any extra information you've determined.