LoginSignup
0
0

More than 3 years have passed since last update.

[iOS8 対応]UILabelをカスタムフォントにすると、クラッシュする問題。

Last updated at Posted at 2014-09-17

Xcode6で実行した

Appdelegate.m
[[UILabel appearance] setFont:[UIFont fontWithName:@"フォント名" size:15]];
TableView
-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
    NSArray *arry = [NSArray arrayWithObjects:NSLocalizedString(@"A",@"B",@"C" nil), nil];

    return [arry objectAtIndex:section];
}
-(NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section
{
     NSArray *arry = [NSArray arrayWithObjects:NSLocalizedString(@"A",@"B",@"C" nil), nil];

    return [arry objectAtIndex:section];
}

titleForHeaderInSection, titleForFooterInSectionで、iOS8環境でクラッシュしてしまう。
下記のエラーメッセージでクラッシュする。

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'scaledValueForValue: called on a font that doesn't have a text style set'

現状

現状は、カスタムフォントを外して個別に設定することで対応しましたが、解決方法はまだ見つけていません。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0