【问题标题】:iMessageExt app Error starting applicationiMessageExt 应用程序启动应用程序错误
【发布时间】:2017-06-28 03:13:41
【问题描述】:

我创建了我的 iMessage 扩展程序,当我尝试打开它时,出现了第一个屏幕,但它完全冻结了,并且没有任何反应。

我已将日志放在第一个视图的 viewDidLoad 中,但那里什么也没有,几秒钟后我已经可以看到这些日志了。

要使应用程序冻结失去该状态,用户必须再次向左或向右滑动屏幕。

我已经尝试在整个网络上寻找恰好是同一个人的人,但我找不到任何东西。

没有想到更多的截图或部分代码添加,如果你认为我应该提供一些额外的信息,请告诉我

任何帮助将不胜感激。

谢谢。

更新:

这是我的项目结构。

这是我的viewDidLoad 代码。

- (void)viewDidLoad
{
    [super viewDidLoad];
    NSLog(@"here viewDidLoad iMessage ext~~~!");
    [self applyCornerRadiusToBtn];
    [self registerPresentationAction];

    NSDictionary *user = [self getUserInfoFromHostApp];
    if (user) {
        NSLog(@"Here != null user info");
        //It is assumed that when you enter this point and run this log, the app should navigate to the next screen, but it does not.
        [self performSegueWithIdentifier:@"goToYoutubeListIm" sender:nil];
    } else {
        NSLog(@"Here userInfo null");
    }
}

- (NSDictionary *)getUserInfoFromHostApp
{
    NSUserDefaults *myDefaults = [[NSUserDefaults alloc] initWithSuiteName:@"group.com.xxxxx"];
    NSDictionary *userNameSaved = [myDefaults objectForKey:@"userInfoExt"];;
    NSLog(@"userNameSaved in xxxx Ext ==> %@",userNameSaved);

    NSURL *groupURL = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:@"group.com.xxxx"];
    NSLog(@"groupURL ==> %@",groupURL);

    return userNameSaved;
}

【问题讨论】:

  • 请提供您在问题中提到的其他信息。
  • 请提供一些代码你是如何创建扩展的,这样我们就可以知道出了什么问题。
  • 当屏幕冻结时暂停应用程序并查看堆栈跟踪的内容。这将引导您到达冻结的位置。
  • 您可以尝试在视图中实现导航代码逻辑( [self performSegueWithIdentifier:@"goToYoutubeListIm" sender:nil]; ),而不是在视图中加载吗?
  • @SahanaKini,感谢您的回答,但不起作用。问题依然存在

标签: ios objective-c ios-app-extension imessage imessage-extension


【解决方案1】:

对于所有相关人员,我发现问题是准确的。

1) 我正在创建我的控制器类型MSMessagesAppViewController。显然这种类型的控制器应该只有一个。

2) 我在MSMessagesAppViewController 中的viewDidAppear 中有逻辑。由于某些奇怪的原因,这也导致了问题,我不得不将逻辑拿出来并强制用户与按钮交互以执行 didAppear 中的逻辑

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-08-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多