无法分发Mac Catalyst扩展 [英] Can't distribute Mac Catalyst extension

查看:69
本文介绍了无法分发Mac Catalyst扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已成功将具有多个扩展名的应用程序上载至iOS的Appstore,但是当我尝试为Mac AppStore(Mac Catalyst应用程序)上载相同的应用程序时,我从两个扩展名的Xcode收到以下错误消息

I successfully uploaded to the Appstore for iOS an app with several extensions, but when I try to upload the same app for Mac AppStore ( a Mac Catalyst App ) I get the following error from Xcode on two extensions

ERROR ITMS-90355: "Missing Info.plist value. No value for NSExtensionPrincipalClass found in extension Info.plist   
for MyApp.app/Contents/PlugIns/MyExtension.appex"

这些扩展是具有情节提要文件的共享扩展和操作扩展,因此,如果我在Info.plist文件中设置NSExtensionPrincipalClass键,则会在控制台中收到以下消息

These extensions are a Share Extension and an Action Extension that have a storyboard file, so if I set the NSExtensionPrincipalClass key in the Info.plist file I get the following message in console

Invalid Configuration: Either NSExtensionMainStoryboard or NSExtensionPrincipalClass   
must be specified in the extension's Info.plist file but not both.

当然,扩展界面不会出现,并且没有任何作用

And of course the extension interface does not appear and nothing works

有人知道如何解决这个问题吗?

Anybody got an idea how to solve this?

或者可以在Info.plist文件中仅设置NSExtensionPrincipalClass键,然后以编程方式调用情节提要文件吗?

Alternatively there is the possibility to set only the NSExtensionPrincipalClass key in the Info.plist file and then call the storyboard file programmatically ?

谢谢大家

范尼

推荐答案

从Alessandro Petrolati的变通方法中获得启发,我认为我找到了一个更简单的解决方案,至少在我看来,这两个扩展都可以很好地工作.

Taking inspiration from Alessandro Petrolati workaround, I think I found a simpler solution that at least in my case works very well in both extensions.

1.  Replace in .plist NSExtensionMainStoryboard with NSExtensionPrincipalClass
2.  Update YourViewController.m file

将此初始化方法添加到您的.m类文件中

Add this init method to your .m class file

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {

        UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"YournStoryboardName" bundle:nil];
        self = (YourViewController*) [storyboard instantiateViewControllerWithIdentifier:@"YourStoryboardID"];
    }
    return self;
}

似乎很容易成为事实...

It seems too easy to be true...

程序包验证成功,最终我成功地将应用程序上传到AppStore Connect!

The package validation was successful and I finally managed to upload the app to the AppStore Connect without any problems!

我要做的就是在上线之前检查最新的详细信息...

All I have to do is to check the latest details before I go live...

尝试相信!

让我知道您的印象

这篇关于无法分发Mac Catalyst扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆