6

I created my iMessage extension, when I try to open it, the first screen appears but it is totally frozen, and it does not react in any way.

I've put logs in the viewDidLoad of that first view and nothing appears there, after a few seconds I can already see those logs.

To make the application freezing lose that status, user has to slide screen left or right and back again.

I've tried looking all over the web for someone who happens to be the same, but I could not find anything.

It does not come to mind more screenshots or portions of code add, if you think I should provide some additional information, just let me know

Any help would be appreciated.

Thank you.

UPDATE:

This is my Project Structure.

enter image description here

This is my viewDidLoad code.

- (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;
}
jose920405
  • 7,982
  • 6
  • 45
  • 71
  • Please provide the additional information that you mentioned in the question. – KrishnaCA Feb 13 '17 at 12:54
  • Please provide some code how you are creating extension so we can get idea whats going wrong. – CodeChanger Feb 13 '17 at 12:56
  • when the screen is frozen pause the app and see what the stacktrace says. This will lead you to where the freezing is. – Bot Feb 13 '17 at 16:33
  • Can you try implementing the navigation code logic ( [self performSegueWithIdentifier:@"goToYoutubeListIm" sender:nil]; ) in view did appear, than in view did load ? – Sahana Kini Feb 15 '17 at 16:40
  • @SahanaKini, thanks for answer but not works. The problem persist – jose920405 Feb 16 '17 at 12:57

1 Answers1

0

For all concerned I have found the problem or problems to be accurate.

1) I was creating my controllers type MSMessagesAppViewController. Apparently there should only be one controller of this type.

2) I had logic in the viewDidAppear in my MSMessagesAppViewController. For some strange reason this also caused the problem, I had to get the logic out there and force the user to interact with a button to execute the logic that was in the didAppear

jose920405
  • 7,982
  • 6
  • 45
  • 71