Native Extension Compile Error
I'm writing a Native Extension that will add Native UIAccessibilityElements in order to use the voice over capabilities in IOS. This is my first Native Extension and I have followed the amazingly helpful tutorial here:
http://www.liquid-photo.com/2011/10/28/native-extension-for-adobe-air-and-ios-101/
so I have a functioning ANE that can communicate with native code and add elements to the View. I am able to add many other objects in a custom View like a UIButton or UILabel, but when I add a UIAccessiblityElement i get this error in Flash Builder when I compile.
Error occurred while packaging the application:
ld: absolute addressing (perhaps -mdynamic-no-pic) used in -[MyView initWithFrame:] from /var/folders/5+/5+qCHDuCFg8yA8ob60zAZlkBXYk/-Tmp-/303a648c-adb7-4249-9173-ba802e88720e/.NativeAccessibility.a(MyView.o) not allowed in slidable image. Use '-read_only_relocs suppress' to enable text relocs
Compilation failed while executing : ld64
I've seen this error referenced in other discussions but the answers were all over the place, and often not even in readable english. But the effort was appreciated
I'm not an Objective C expert, but I'm getting better. But I'm probably doing something wrong in Obj-C. At this point I've narrowed the error to the point where I set the accElem.accessibilityTraits. Now I'm completely stuck. Here is my code for my custom View in which i am created the Element, I'm also creating a button just to test that stuff is working:
#import "MyView.h"
@implementation MyView
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
CGRect localRect = CGRectMake( 10, 200, 100, 30 );
CGRect globalRect = CGRectOffset(localRect, CGRectGetMinX(self.accessibilityFrame), CGRectGetMinY(self.accessibilityFrame));
UIAccessibilityElement *accElem = [[UIAccessibilityElement alloc] initWithAccessibilityContainer:self];
accElem.isAccessibilityElement = YES;
accElem.accessibilityFrame = globalRect;
accElem.accessibilityHint = [NSString stringWithFormat:NSLocalizedString(@"xyz %@", nil), @"hint"];
accElem.accessibilityTraits = UIAccessibilityTraitButton;// if I comment this out I get no error in Flash Builder compile, but i get no element on the screen
accElem.accessibilityLabel =@"Label";
[accElem release];
CGRect buttonFrame1 = CGRectMake( 10, 120, 100, 30 );
UIButton *button1 = [[UIButton alloc] initWithFrame: buttonFrame1];
[button1 setTitle: @"My Button" forState: UIControlStateNormal];
[button1 setTitleColor: [UIColor redColor] forState: UIControlStateNormal];
[self addSubview: button1];
}
return self;
}
@8978565
Any help would be greatly appreciated....
