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

ANE: How to load XIB file?

Community Beginner ,
Sep 22, 2018 Sep 22, 2018

Copy link to clipboard

Copied

Hi, guys!

Our ANE is trying to load a portion of user interface from .xib file.

Unfortunately it fails with a crash.

Is it even possible in AIR?

We put the XIB file "CustomViewController.xib" in the root of .ipa package.

And here's the native code that loads the XIB.

UINib *uiNib = [UINib nibWithNibName:@“CustomViewController” bundle:[NSBundle mainBundle]];

//uiNib is NOT nil at this point. So it was found and loaded.

//But the following line crashes.

UIView *view = [uiNib instantiateWithOwner:self options:nil].firstObject;

This message is printed to the console.

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException',

reason: 'Could not load NIB in bundle: 'NSBundle </var/containers/Bundle/Application/295E25B2-DF66-426D-8DD0-FDF5C816943D/YoWindow Weather.app> (loaded)' with name 'CustomViewController''

This is except from the crash.

Exception Type:  EXC_CRASH (SIGABRT)

Exception Codes: 0x0000000000000000, 0x0000000000000000

Exception Note:  EXC_CORPSE_NOTIFY

Triggered by Thread:  0

Application Specific Information:

abort() called

Filtered syslog:

None found

Last Exception Backtrace:

0   CoreFoundation                  0x183d2ed8c __exceptionPreprocess + 228

1   libobjc.A.dylib                 0x182ee85ec objc_exception_throw + 55

2   CoreFoundation                  0x183d2ec6c +[NSException raise:format:] + 115

3   UIKit                           0x18dfafd2c -[UINib instantiateWithOwner:options:] + 467

     

The code works just fine in a standalone application but fails when run inside AIR.

Has anyone managed to successfully load a XIB in ANE?

TOPICS
Development

Views

469

Translate

Translate

Report

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