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

Update ANE with AIR 22 is not working anymore

Explorer ,
Apr 27, 2016 Apr 27, 2016

Copy link to clipboard

Copied

Hi,

I have a simple ANE which shares File.

It was built with AIR 19.0 and Xcode 6.1.

I want to update to AIR 22, but you have updated the iOS SDK, I have installed XCode 7.3, base SDK is iOS 9.3 and iOS Deployment target is iOS 9.0.

I have a platform.xml like this.

<sdkVersion>9.0.0</sdkVersion>

    <linkerOptions>

        <option>-framework AudioToolbox</option>

        <option>-framework AVFoundation</option>

        <option>-framework CFNetwork</option>

        <option>-framework CoreFoundation</option>

        <option>-framework CoreGraphics</option>

        <option>-framework CoreLocation</option>

        <option>-framework CoreMedia</option>

        <option>-framework CoreVideo</option>

        <option>-framework Foundation</option>

        <option>-framework MobileCoreServices</option>

        <option>-framework OpenGLES</option>

        <option>-framework QuartzCore</option>

        <option>-framework Security</option>

        <option>-framework SystemConfiguration</option>

        <option>-framework UIKit</option>

        <option>-framework ImageIO</option>

        <option>-framework CoreTelephony</option>

    </linkerOptions>

My code to share a file is, in objective-C, where the variable URL is a NSURL, the path of a local file

@try {

  

            UIViewController * controler = [[[[UIApplication sharedApplication] windows] objectAtIndex:0] rootViewController];

          

            UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:@[URL] applicationActivities:nil];

            //activityVC.excludedActivityTypes = @[UIActivityTypePrint, UIActivityTypeCopyToPasteboard, UIActivityTypeAssignToContact, UIActivityTypeSaveToCameraRoll]; //or whichever you don't need

          

          

            UIPopoverController *popup = [[UIPopoverController alloc] initWithContentViewController:activityVC];

            [popup presentPopoverFromRect:CGRectMake(0,0,0,0) inView:controler.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];

        }

        @catch (NSException *exception) {

            DISPATCH_STATUS_EVENT(context,"DEBUG_TRACE", (const uint8_t*) [exception.reason UTF8String]);

        }

I have this error at execution: *** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]

UIPopoverController is deprecated now, I triied to update my code, following this http://www.goxuni.com/672368-adding-a-share-button-to-an-objective-c-ios-app/ 

And the result is:

@try {

            UIViewController * controler = [[[[UIApplication sharedApplication] windows] objectAtIndex:0] rootViewController];

           

           

            NSArray *activityItems = @[URL];

            UIActivityViewController *activityViewControntroller = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil];

            activityViewControntroller.excludedActivityTypes = @[];

           

            activityViewControntroller.modalPresentationStyle = UIModalPresentationFullScreen;

            if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)

            {

                activityViewControntroller.popoverPresentationController.sourceView = controler.view;

                activityViewControntroller.popoverPresentationController.sourceRect = CGRectMake(controler.view.bounds.size.width/2, controler.view.bounds.size.height/4, 0, 0);

            }

            [controler.self presentViewController:activityViewControntroller animated:true completion:nil];

           

        }

        @catch (NSException *exception) {

            DISPATCH_STATUS_EVENT(context,"DEBUG_TRACE", (const uint8_t*) [exception.reason UTF8String]);

        }

The error is the same: *** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]

I really don't understand why this was working before, and now with new AIR SDK, new Xcode and new iOS SDK, it's not working.

TOPICS
Air beta

Views

650

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

correct answers 1 Correct answer

Explorer , May 12, 2016 May 12, 2016

Votes

Translate

Translate
Explorer ,
May 12, 2016 May 12, 2016

Copy link to clipboard

Copied

LATEST

Votes

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