Implementing mobFox causes crash - iphone

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

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?

pointCounts error using MKOverlay

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.

iPhone SDK / iOS crash in webview / scrollview?

I'm having really strange crash in my application. It occurs randomly. Basically, I'm having large scroll view containing multiple UIWebViews, which I'm loading from HTML string. After some time, following crash appears:
*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSMutableArray objectAtIndex:]: index 7 beyond bounds [0 .. 6]'
*** Call stack at first throw:
(
0 CoreFoundation 0x0110dbe9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x00f025c2 objc_exception_throw + 47
2 CoreFoundation 0x011036e5 -[__NSArrayM objectAtIndex:] + 261
3 CoreFoundation 0x010866e5 -[NSMutableArray removeObject:range:identical:] + 437
4 CoreFoundation 0x01086520 -[NSMutableArray removeObject:] + 96
5 UIKit 0x0035e7c0 -[UIView(UIViewGestures) removeGestureRecognizer:] + 112
6 UIKit 0x005f85c1 -[UIWebSelectionAssistant setGestureRecognizers] + 58
7 UIKit 0x004b0d09 -[UIWebDocumentView loadHTMLString:baseURL:] + 286
8 CoreFoundation 0x0107e67d __invoking___ + 29
9 CoreFoundation 0x0107e551 -[NSInvocation invoke] + 145
10 WebCore 0x0217f3c3 _ZL15HandleAPISourcePv + 147
11 CoreFoundation 0x010ef01f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
12 CoreFoundation 0x0104d28b __CFRunLoopDoSources0 + 571
13 CoreFoundation 0x0104c786 __CFRunLoopRun + 470
14 CoreFoundation 0x0104c240 CFRunLoopRunSpecific + 208
15 CoreFoundation 0x0104c161 CFRunLoopRunInMode + 97
16 WebCore 0x02240423 _ZL12RunWebThreadPv + 499
17 libSystem.B.dylib 0x901ea85d _pthread_start + 345
18 libSystem.B.dylib 0x901ea6e2 thread_start + 34
)
terminate called after throwing an instance of 'NSException'
I really can not resolve this, because crashes are random and seem to be in CoreFoundation, which I do not controll directly. Any suggestion?
Thank you very much for any help!
Not really an answer to your issue, but: be aware that Apple recommend against putting UIWebViews inside UIScrollViews. It's certainly possible to do, in my experience, but just be warned that wacky things might happen.
Related question:
Two resizable UIWebViews inside UIScrollView
The problem is in your gesture recognizers. The UIView is attempting to remove a recognizer that is presumably not there. It accesses index 7 of the 6 element array causing the crash.
I would check any customizations of the gestures you might have done.

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.