Copy link to clipboard
Copied
Hi,
I am new to Objective C and am trying for some days already to get an iOS AIR native extension working.
I am confronted with the following problem:
Withing my function I have an NSString and would like to pass this over to the ActionsScript side as a "String". How can I create an adequate FREObject out of an NSString ???
Thanks for you help,
Henning
Copy link to clipboard
Copied
It's pretty simple once you figure it out. In your FREFunction you'll need:
NSString * someString = @"test string";
FREObject result = NULL;
FRENewObjectFromUTF8( strlen((const char*)[someString UTF8String]) + 1, (const uint8_t*)[someString UTF8String], &result);
return result;