使用.xib更新装置上的应用程式已移除当机应用程式 [英] Updating app on device with .xib removed crashes app

查看:159
本文介绍了使用.xib更新装置上的应用程式已移除当机应用程式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个旧版本的应用程式安装在装置上。在我的新版本中,我不再使用.xib文件,因为它从一个复杂的,只是一个表视图,我可以实例化它的代码。

I have an older version of an app installed on a device. In my new version I no longer had use of a .xib file as it changed from something complex to just a table view and I can instantiate it in code.

当我在设备上构建和运行时崩溃,因为它仍然尝试从旧应用程序中包含的.xib文件加载控制器,并抱怨UILabel缺少一个键/值对。

However, when I build and run on the device it crashes as it still tries to load the controller from the .xib file contained in the older app, and complains about a key/value pair missing for a UILabel.

例如:

SomeViewController.h(UITableViewController)

SomeViewController.m

SomeViewController。 xib(在新版本中移除)

SomeViewController.h (UITableViewController)
SomeViewController.m
SomeViewController.xib (removed in new version)

SomeViewController *controller = [[SomeViewController alloc] initWithStyle:UITableViewStylePlain];

- (id)initWithStyle:(UITableViewStyle)style
{
    self = [super initWithStyle:style];

    if (self)
    {
    }

    return self;
}

即使我调用initWithStyle,它仍然尝试加载预先存在.xib!

Even though I call "initWithStyle" it still tries to load the pre-existing .xib!

我当前的解决方案是创建一个空白的UITableView的SomeViewController.xib。

My current solution is to create SomeViewController.xib with a blank UITableView.

,当用户从应用商店更新应用程序时,它将覆盖整个应用程序,不会留下任何东西。

I suspect however, that when users update the app from the app store it will overwrite the entire app and not leave anything behind.

这是真的吗?应用程式更新会覆写现有的应用程式,还是会留下逗留的.xib档案?

Is this true? Do app updates overwrite the existing app or does it leave lingering .xib files?

现在,我必须测试旧版本与其他视图,以确保没有其他问题

Now I have to test the older version with every other view to insure there is no other problems lingering.

阅读NIB的开发人员文字:
http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/LoadingResources/CocoaNibs/CocoaNibs.html

Reading through the developer text on NIB's: http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/LoadingResources/CocoaNibs/CocoaNibs.html

也许我发现了一个错误?

Perhaps I found a bug?

另一种选择是让我重新命名类否则像SomeController,以避免自动加载相关的.xib文件。

Another option is for me to re-name the class to something else like SomeController so as to avoid automatically loading the associated .xib file.

推荐答案

Apple在以下技术说明中解决了这个问题关于测试iOS应用程式更新:

Apple has addressed this issue in the following technical note regarding testing iOS app updates:

技术说明TN2285

这篇关于使用.xib更新装置上的应用程式已移除当机应用程式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆