pointCounts error using MKOverlay - iphone

I have problem with custom overlay. The problem is I cant identify error code, its occurs randomly
Maybe someone will be able to help me basic on this stack. What is pointCount?
2012-07-30 02:02:01.187 MyApp[454:8107] -[MyRegionOverlay pointCount]: unrecognized selector sent to instance 0x5d7dab0
2012-07-30 02:02:01.190 MyApp[454:8107] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MyRegionOverlay pointCount]: unrecognized selector sent to instance 0x5d7dab0'
*** Call stack at first throw:
(
0 CoreFoundation 0x016c15a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x01815313 objc_exception_throw + 44
2 CoreFoundation 0x016c30bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x01632966 ___forwarding___ + 966
4 CoreFoundation 0x01632522 _CF_forwarding_prep_0 + 50
5 MapKit 0x008186c4 _ZL20createPathForPolygonP9MKPolygon10MKMapPoint + 55
6 MapKit 0x00818817 -[MKPolygonView createPath] + 95
7 MapKit 0x0081d715 -[MKOverlayPathView drawMapRect:zoomScale:inContext:] + 79
8 MapKit 0x00838328 -[MKOverlayClusterView drawLayer:inContext:] + 1450
9 QuartzCore 0x00472b5e -[CALayer drawInContext:] + 143
10 QuartzCore 0x00489283 _ZL18tiled_layer_renderP16_CAImageProviderjjjjPv + 1648
11 QuartzCore 0x003d1eb2 _ZL21CAImageProviderThreadPjb + 475
12 libSystem.B.dylib 0x91bce781 _pthread_wqthread + 390
13 libSystem.B.dylib 0x91bce5c6 start_wqthread + 30
)

What the error means is that there is an MKPolygonView in your overlay. The polygon property of the MKPolygonView is set to an instance of MyRegionOverlay. Unfortunately MyRegionOverlay is not a subclass of MKPolygon as it is supposed to be. So when the pointCount message is sent to the MyRegionOverlay you get a run time error "unrecognized selector" since MyRegionOverlay apparently does not respond to pointCount.

Related

Swift macOS - -[_SwiftValue objCType]: unrecognized selector sent to instance

Here is a truncated version of the error:
2018-09-30 16:11:12.786201-0700 MacPlayground[57283:3255328] -[_SwiftValue objCType]: unrecognized selector sent to instance 0x6040004464e0
2018-09-30 16:11:12.786610-0700 MacPlayground[57283:3255328] [General] -[_SwiftValue objCType]: unrecognized selector sent to instance 0x6040004464e0
2018-09-30 16:11:12.793434-0700 MacPlayground[57283:3255328] [General] (
0 CoreFoundation 0x00007fff3f6a12db __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00007fff66856c76 objc_exception_throw + 48
2 CoreFoundation 0x00007fff3f739db4 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x00007fff3f617820 ___forwarding___ + 1456
4 CoreFoundation 0x00007fff3f6171e8 _CF_forwarding_prep_0 + 120
5 QuartzCore 0x00007fff4aa0cf8c _ZL9getValuesP7NSValuePdRm + 51
6 QuartzCore 0x00007fff4aa0cbba -[NSValue(CAAnimatableValue) CA_interpolateValue:byFraction:] + 159
7 QuartzCore 0x00007fff4a996855 -[CABasicAnimation applyForTime:presentationObject:modelObject:] + 532
8 QuartzCore 0x00007fff4a9a6df1 _ZN2CA5Layer18presentation_layerEPNS_11TransactionE + 683
9 UICore 0x000000010035d5a0 $SSo6NSViewC6UICoreE23currentlyPresentedValue33_87359CB0FAD3031CD028C558F7C6F5D1LL6forKeyypSgSS_tF + 1248)
This occurs (under certain unknown conditions) when I call layer.presentation() on the backing layer of an NSView. Does anyone know why getting the presentation layer could result in the unrecognized selector error?

Error in dismissing a modal view controller

I have encountered application termination while dismissing a modal view controller.
-[NSCFString window]: unrecognized selector sent to instance 0x6337dc0
2011-06-03 13:26:37.980 Tuscany[19657:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString window]: unrecognized selector sent to instance 0x6337dc0'
*** Call stack at first throw:
(
0 CoreFoundation 0x016ffbe9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x018545c2 objc_exception_throw + 47
2 CoreFoundation 0x017016fb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x01671366 ___forwarding___ + 966
4 CoreFoundation 0x01670f22 _CF_forwarding_prep_0 + 50
5 UIKit 0x003f4024 -[UIViewController viewControllerForRotation] + 81
6 UIKit 0x003ee8ab -[UIViewController shouldWindowUseOnePartInterfaceRotationAnimation:] + 34
7 UIKit 0x00368dd5 -[UIWindow _clientsForRotation] + 350
8 UIKit 0x0036b87b -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 141
9 UIKit 0x005eb948 -[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:] + 1053
10 UIKit 0x003f7682 -[UIViewController _dismissModalViewControllerWithTransition:from:] + 2075
11 UIKit 0x003f4324 -[UIViewController dismissModalViewControllerWithTransition:] + 579
12 Foundation 0x000c37f6 __NSFireDelayedPerform + 441
13 CoreFoundation 0x016e0fe3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 19
14 CoreFoundation 0x016e2594 __CFRunLoopDoTimer + 1220
15 CoreFoundation 0x0163ecc9 __CFRunLoopRun + 1817
16 CoreFoundation 0x0163e240 CFRunLoopRunSpecific + 208
17 CoreFoundation 0x0163e161 CFRunLoopRunInMode + 97
18 GraphicsServices 0x01d88268 GSEventRunModal + 217
19 GraphicsServices 0x01d8832d GSEventRun + 115
20 UIKit 0x0035342e UIApplicationMain + 1160
21 Tuscany 0x00002878 main + 102
22 Tuscany 0x00002809 start + 53
)
terminate called after throwing an instance of 'NSException'
Above is the crash log. Please help.
Thanks in advance.
From you log it seems that you are calling window on an NSCFString. NSCFString does not have a window selector, and the compiler would complain if you try and do so, so it is likely that you are sending that message to a deallocated object (imagine that a new object has been allocated where another one was previously), or you are messing with casts.
In case you suspect that you are sending the message to a deallocated object, enable NSZombies.
Without seeing the code, it is not possible to help you further, though.

Implementing mobFox causes crash

Just trying to implement mobFox into my app, but having trouble to make it run. I suspect that it is because of my general approach not to use IB at all, because the sample code works just fine.
After run it is pointing to the line
int retVal = UIApplicationMain(argc, argv, nil, #"UntitledAppDelegate");
which is in my main.m,
with this as result
2011-04-18 16:07:48.000 BinTeeth[10141:bf07] -[NSCFString md5]: unrecognized selector sent to instance 0x622ef40
2011-04-18 16:07:48.001 BinTeeth[10141:bf07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString md5]: unrecognized selector sent to instance 0x622ef40'
*** Call stack at first throw:
(
0 CoreFoundation 0x014845a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x015d8313 objc_exception_throw + 44
2 CoreFoundation 0x014860bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x013f5966 ___forwarding___ + 966
4 CoreFoundation 0x013f5522 _CF_forwarding_prep_0 + 50
5 BinTeeth 0x0002d90f -[MobFoxBannerView asyncRequestAdWithPublisherId:] + 177
6 Foundation 0x00670cf4 -[NSThread main] + 81
7 Foundation 0x00670c80 __NSThread__main__ + 1387
8 libSystem.B.dylib 0x9758c85d _pthread_start + 345
9 libSystem.B.dylib 0x9758c6e2 thread_start + 34
)
terminate called after throwing an instance of 'NSException'
any help would be appreciated, I have tried many things, but nothing really looks loke solution for me so far
tnx
Did you set the linker-flags as described in the SDK documentation?
Best

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.