2

我的测试仪在 iPhone 2G 和 iOS 3.1.3 上。应用程序使用这种方法在他的手机上崩溃:

- (void) viewDidLoad 
{
    [super viewDidLoad];

    [resumeGame.titleLabel setFont:[UIFont fontWithName:@"Old English Text MT" size:20.0]];
    [startNewGame.titleLabel setFont:[UIFont fontWithName:@"Old English Text MT" size:20.0]];
    [options.titleLabel setFont:[UIFont fontWithName:@"Old English Text MT" size:20.0]];   
}        

和界面:

@interface PuzzleViewController : UIViewController 
{
    IBOutlet UIButton *resumeGame;
    IBOutlet UIButton *startNewGame;
    IBOutlet UIButton *options;
}

@property (nonatomic, retain) IBOutlet UIButton *resumeGame;
@property (nonatomic, retain) IBOutlet UIButton *startNewGame;
@property (nonatomic, retain) IBOutlet UIButton *options;

字体被复制到资源文件夹中,并且“Info.plist”“应用程序提供的字体”设置正确。

知道如何解决这个问题吗?

4

2 回答 2

4

根据有关 UIKit Keys 的文档,自定义字体在 iOS 3.2 中可用。这很可能是您的代码在 iOS 3.1.3 上失败的原因(或者正如它在当天被召回的那样 - iPhone OS 3.1.3)。

于 2011-03-27T14:28:46.213 回答
1

首先我想告诉你,很少有人使用 iPhone 2G 和 iOS 3.1.3。事实上,很少有人使用低于 iOS 4.0 的任何东西。除非客户明确要求,否则我们通常不支持低于 4.0 的任何内容。如果我们在较低版本的 iOS 上发现错误,我们就会放弃对该版本的支持,因为不值得花时间修复它。

如果您仍然决定要修复此错误,则必须提供堆栈跟踪,否则我们将很难告诉您出了什么问题。

编辑:正如 Bartosz 指出的那样,您正在使用 iOS 3.1.3 中不可用的功能。如果您需要自定义字体,您将无法支持低于 3.2 的任何内容。iOS 3.2 仅适用于 iPad,因此如果您的应用仅适用于 iPhone,则意味着您将不支持 4.0 以下的任何内容。正如我在原始答案中指出的那样,大多数用户以任何方式使用 >=4.0。

于 2011-03-27T13:13:37.873 回答