HD_92
HD_92

Reputation: 197

Monotouch iOS binding works on iOS 6 but fails under iOS 5

I've created a Monotouch iOS binding for the latest version of the Chartboost SDK. It works fine when I run it on the iOS 6 Simulator but fails on the iOS 5 Simulator.

The error message:

NSInvalidArgumentException reason: -[__NSCFDictionary setObject:forKeyedSubscript:]: unrecognized selector sent to instance 0x11b8cce0

0   blockpuzzle      0x0016c94e mono_handle_exception_internal_first_pass + 2190
1   blockpuzzle      0x0016e392 mono_handle_exception_internal + 1602
2   blockpuzzle      0x0016eedf mono_handle_exception + 47
3   blockpuzzle      0x001b2012 mono_x86_throw_exception + 306
4   ???              0x09bc5f8f 0x0 + 163340175
5   blockpuzzle      0x002f40ee monotouch_exception_handler + 158
6   CoreFoundation   0x038ce12c __handleUncaughtException + 76
7   libobjc.A.dylib  0x03a5ff43 _objc_terminate + 86
8   libc++abi.dylib  0x03f738de _ZL19safe_handler_callerPFvvE + 13
9   libc++abi.dylib  0x03f73946 __cxa_bad_typeid + 0
10  libc++abi.dylib  0x03f74ab2 _ZL23__gxx_exception_cleanup19_Unwind_Reason_CodeP17_Unwind_Exception + 0
11  libobjc.A.dylib  0x03a5fe15 _objc_exception_destructor + 0
12  CoreFoundation   0x038cfced -[NSObject doesNotRecognizeSelector:] + 253
13  CoreFoundation   0x03834f00 ___forwarding___ + 432
14  CoreFoundation   0x03834ce2 _CF_forwarding_prep_0 + 50
15  blockpuzzle      0x00026777 -[CBAPIConnection sendRequest:success:failure:] + 1175
16  blockpuzzle      0x000262db -[CBAPIConnection sendRequest:success:] + 55
17  blockpuzzle      0x0002361f -[Chartboost startSession] + 468
at (wrapper managed-to-native) MonoTouch.ObjCRuntime.Messaging.void_objc_msgSend (intptr,intptr) <IL 0x0000a, 0x0002c>
at com.blueriver.chartboost.Chartboost.startSession () <IL 0x00016, 0x00028>

I've set the iOS build SDK version for my project to 6.1 and the deployment target (minimum OS version) to 4.3.

What am I missing?

[Update] I've put my binding onto pastebin: http://pastebin.com/KfTztyDP. Maybe it's some help.

Upvotes: 3

Views: 618

Answers (2)

HD_92
HD_92

Reputation: 197

I found the answer thanks to the answer by dalexsoto over here: MonoTouch "unrecognized selector sent to instance" not working on iOS5 (but does on iOS6).

I just needed to add lib arclite.a to my Monotouch binding project and it worked.

If anybody has the same or similar problem just download that library over here https://github.com/PSPDFKit/XamarinBindings/tree/master/AlexTouch.PSPDFKit and add it to your binding project.
Thanks to the new Xamarin Studio you do not need to fiddle around with dlls created by the bindings. Just add a reference to your binding project in your main project and everything is alright.

Upvotes: 2

Jason
Jason

Reputation: 89214

forKeyedSubscript was added in iOS 6. Do their docs say they support iOS 5, or is there a different version of the library for older systems?

Upvotes: 2

Related Questions