我正在寻找 4 天,但无法找到任何解决方案。
在我的 iOS 应用程序中,我正在尝试使用推送通知,那里没有问题。我收到通知,并且didReceiveRemoteNotification
使用以下代码的方法我可以毫无问题地访问详细视图。
NSDictionary *aps = [userInfo objectForKey:@"aps"];
NSArray *array = [[aps objectForKey:@"acme"] componentsSeparatedByString:@","];
NSArray *fixtureArray = [[CreateFixture alloc] createFixtureWithArray:array andStyle:@"single"];
UINavigationController *navController = (UINavigationController *)self.window.rootViewController;
UIViewController *root = navController.topViewController;
FPViewController *vc = [[FPViewController alloc] init];
[vc createViewWithArray:fixtureArray];
NSArray *vcs = [NSArray arrayWithObjects:root, vc, nil];
[navController setViewControllers:vcs animated:YES];
didFinishLaunchingWithOptions
当我完全关闭应用程序并发送通知时,我的应用程序按预期打开。我在以下if
语句中使用相同的代码:
if (launchOptions != nil)
{
NSDictionary* dictionary = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
if (dictionary != nil)
{
same code above
}
}
但!!!这次我的详细视图提出了不同的 xy 和宽度高度。所以应用程序变得毫无用处。一些标签和按钮没有看到一些视图更大和一些其他视图。我找不到任何解决方案请帮助!(所有视图、标签、按钮等都是以编程方式创建的)我将 autoresizingMask 用于横向和纵向窗口。我愿意接受任何建议。谢谢你的帮助。