I am getting the following error linking against the Aviary SDK using MonoTouch.

-[__NSArrayM objectAtIndexedSubscript:]: unrecognized selector sent to instance 0x9b0f1d0

The problem occurs when I try to push the linked controller.

PresentViewController(photoEditor, true, new NSAction(() => {}));

I have pushed/shared my project to https://github.com/theonlylawislove/MonoTouch.Aviary where you can reproduce the problem.

My Demo application works on iOS 6 simulator, but the mentioned error happens on iOS 5 simulator (and device).

I took all the content (.a/bundles) straight from the latest Aviary SDK 3.0. The demo application provided by them (with same .a lib) works on iOS 5 so the problem must be with MonoTouch and the linking.

Here is my linking flags.

[assembly: LinkWith ("libAviarySDK.a", 
                     LinkTarget = LinkTarget.ArmV7 | LinkTarget.Simulator, 
                     ForceLoad = true, 
                     IsCxx = true,
                     Frameworks="Accelerate CoreData CoreText Foundation MessageUI OpenGLES QuartzCore StoreKit SystemConfiguration UIKit", 
                     WeakFrameworks="AdSupport",
                     LinkerFlags="-ObjC -all_load -fobjc-arc -lz -lsqlite3.0")]

Any ideas? Thanks in advance! I am hoping to get the solution working to share it with the community since Aviary doesn't provide MonoTouch bindings.

有帮助吗?

解决方案

Complementing @Poupou's answer, it's easy to make that selector available in iOS 5 all you need is to link against libarclite.a.

Here is a sample of a Xamarin.iOS binding using it also if you want you can grab libarclite.a from there.

Just add libarclite.a to your binding project and you should be good to go.

Hope this helps

Alex

其他提示

Well the error is correct in the sense that the objectAtIndexedSubscript: selector is not available in iOS5. See: Is objectAtIndexedSubscript available in IOS5?

the demo application provided by them (with same .a lib) works on iOS 5

That does not mean your demo hits the same code path as the original demo. You're likely executing something that the original demo works around.

If this comes from the Aviary SDK (and not from your code) then you'll need:

  • a fix from them; or
  • some clue on how to avoid the code path that use this selector (there must be one if their demo works on iOS5 and does what you want); or
  • an older version is still compatible with iOS5.
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top