gpt4 book ai didi

iOS App 仅在 iPad Pro 上崩溃 : NSUnknownKeyException

转载 作者:行者123 更新时间:2023-12-01 18:47:22 25 4
gpt4 key购买 nike

我有一个用户报告我的应用程序在他的 iPad Pro 的启动屏幕上卡住,但可以在所有其他设备上运行——iPhone 6 plus 和 iPad Mini 都运行 iOS 9.2。我没有收到此版本的崩溃报告,并且还可以看到其他 iPad 设备运行该应用程序正常,所以我怀疑存在一些本地文件损坏问题。就在我写给用户关于如何卸载重装的信息时,我尝试在 iPad Pro 模拟器上运行该应用程序。繁荣。他是对的。在启动屏幕卡住并引发异常。 (是的,我内心的 Bart Simpson 正在黑板上写 100 倍:在发布前在所有模拟器上测试)。

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key view.'



在 Stackoverflow 的其他地方,此错误为 attributed to a bad outlet .据我所知,那里没有问题:
Screen shot of MainViewController.xib and outlets

Viewcontroller having a bad class .作为候选人,我将其排除在外,因为我认为这不会是单设备故障,而且因为我的应用程序是在 Cordova 中构建的,所以它会移交给 webview。

异常在 main.m 中引发,这是一个由cordova 生成的文件:
#import <UIKit/UIKit.h>

int main(int argc, char* argv[])
{
@autoreleasepool {
int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate");
return retVal;
}
}

我还阅读了有关格式不正确的启动屏幕导致问题的问题,并且由于我为 iPad Pro 添加的启动屏幕图像是自上一个版本以来我的代码中新增的内容,所以这是我的第一个嫌疑人。但是我检查了像素大小和分辨率以及我所有的启动屏幕图像 comply to the specs at Apple's developer site.

所以。任何想法仅 iPad Pro 会在发布时立即导致卡住?该应用程序的第一步是查找写入本地存储的文件——如果找不到,则写入一个文件。同样,除非 Pro 处理本地存储的方式有很大不同,否则我认为不可能是这样,因为该过程适用于所有其他 iOS 设备。如果在实际硬件上运行将帮助任何人诊断, the app's here in the app store ,我很高兴发送下载代码。

最佳答案

这是一个令人尴尬的简单问题:不知道怎么做,但主界面框被滚动到 MainViewController.xib 仅适用于 ipad。对于 Cordova 应用程序,它应该是空白的,它位于部署信息页面的默认 iPhone View 中。当我点击 iPad 按钮时,错误的选择就显示出来了。删除它,重新编译,一切都很好。
screen shot of deployment info showing ipad main interface choice as mainviewcontroller

关于iOS App 仅在 iPad Pro 上崩溃 : NSUnknownKeyException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34439745/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com