Skip to main content
Devarai
Known Participant
November 30, 2011
Question

Objective C NSString ==> FREObject

  • November 30, 2011
  • 1 reply
  • 1481 views

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

This topic has been closed for replies.

1 reply

marchbold
Inspiring
October 11, 2012

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;

air native extensions // https://airnativeextensions.com