jos*_*405 6 objective-c ios imessage ios-app-extension imessage-extension
我创建了我的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;
}
Run Code Online (Sandbox Code Playgroud)
对于所有相关人员,我发现这个或多个问题是准确的。
1)我正在创建我的控制器类型MSMessagesAppViewController。显然这种类型的控制器应该只有一个。
2)我viewDidAppear的 中有逻辑MSMessagesAppViewController。由于某些奇怪的原因,这也导致了问题,我必须将逻辑放在那里并强制用户与按钮交互以执行 didAppear 中的逻辑