Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
Locked
0

Objective C NSString ==> FREObject

Explorer ,
Nov 30, 2011 Nov 30, 2011

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

TOPICS
Development
1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 10, 2012 Oct 10, 2012
LATEST

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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines