Creating an Adobe AIR Native Extension that uses the following objC code will crash in iOS 5.1
NSDictionary *value=[NSDictionary dictionaryWithObjectsAndKeys: @"aSampleValue",@"aSampleKey",nil];
NSLog(@"Try objectForKeyedSubscript: %@", [value objectForKeyedSubscript:@"aSampleKey"]);
It will fail with "[__NSCFDictionary objectForKeyedSubscript:]: unrecognized selector"
I've got it working right now using Method Swizzling to remap NSDictionary objectForKeyedSubscript: to valueForKey: (if it doesn't exist) but I'm not super happy with that workaround. There's got to be a platform.xml option or compiler flag that will not strip these function calls in iOS 5.1 but I can't find anything. My
Note: This problem might look a lot like the following (and a few others, but I don't have the rep for the links) but it's not because a native xCode project works fine, but an ANE compiled with ADT does not.
Things tried and failed:
SPECS
FlashBuilder/AIR: SDK3.7 ADT -version: 3.7.0.1530
xCode project BaseSDK: 6.1 (latest) Valid Architectures: armv7 armv7s Deployment Target: iOS 5.1
Platform.XML (it's pretty long since it has some other support requirements)
<platform xmlns="http://ns.adobe.com/air/extension/3.7">
<linkerOptions>
<option>-ObjC</option>
<option>-weak_framework Accounts</option>
<option>-framework AddressBook</option>
<option>-framework AddressBookUI</option>
<option>-weak_framework AdSupport</option>
<option>-framework CoreLocation</option>
<option>-framework CoreMotion</option>
<option>-framework CoreTelephony</option>
<option>-framework EventKit</option>
<option>-framework EventKitUI</option>
<option>-framework iAd</option>
<option>-framework MapKit</option>
<option>-framework MediaPlayer</option>
<option>-framework MessageUI</option>
<option>-framework OpenAL</option>
<option>-weak_framework PassKit</option>
<option>-framework StoreKit</option>
<option>-weak_framework Twitter</option>
<option>-framework UIKit</option>
<option>-lsqlite3</option>
<option>-lxml2</option>
<option>-lz</option>
</linkerOptions>
</platform>
ADT Build Command:
adt -package -target ane build/MyANEName.ane ANE/extension.xml -swc ANE/MyANEName.swc -platform iPhone-ARM -platformoptions ANE/platform.xml -C ANE/ios .