My tester has in iPhone 2G with iOS 3.1.3. The application crashes on his phone on this method:
- (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]];
}
And the Interface:
@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;
The font is copied in the Resources folder and the “Info.plist” “Font provided by application” is set properly.
Any idea how to fix this?
According to documentation on UIKit Keys, custom fonts became available in iOS 3.2. This is most likely the reason for your code to fail on iOS 3.1.3 (or as it was called back in the day – iPhone OS 3.1.3).