0
몇 시간 동안 UIPickerView에 대한 예외를 쫓고 있습니다. 델리게이트 메서드 중 하나로 축소했습니다.하지만 정직하게는 알 수 없습니다. 아이폰에서 기본적으로 제공되는 폰트 패밀리 목록을 가져 와서 피커보기에서 자신이 나타내는 글꼴로 표시합니다.UIPickerView 예외
-(NSAttributedString *)pickerView:(UIPickerView *)pickerView attributedTitleForRow:(NSInteger)row forComponent:(NSInteger)component
{
NSLog(@"attributedTitleForRow");
NSString *fontName = [self.fontFamilies objectAtIndex:row];
NSLog(@"Font: %@", fontName);
NSDictionary *attributes = @{NSFontAttributeName:fontName};
NSLog(@"Attributes: %@", attributes);
NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:fontName attributes:attributes];
NSLog(@"Returning %@", attributedString);
return attributedString;
}
인쇄물 예외 :
2013-07-31 23:28:42.875 [4689:907] attributedTitleForRow
2013-07-31 23:28:42.876 [4689:907] Font: Thonburi
2013-07-31 23:28:42.879 [4689:907] Attributes: {
NSFont = Thonburi;
}
2013-07-31 23:28:42.881 [4689:907] Returning Thonburi{
NSFont = Thonburi;
}
2013-07-31 23:28:42.884 [4689:907] attributedTitleForRow
2013-07-31 23:28:42.886 [4689:907] Font: Snell Roundhand
2013-07-31 23:28:42.887 [4689:907] Attributes: {
NSFont = "Snell Roundhand";
}
2013-07-31 23:28:42.889 [4689:907] Returning Snell Roundhand{
NSFont = "Snell Roundhand";
}
2013-07-31 23:28:42.892 [4689:907] attributedTitleForRow
2013-07-31 23:28:42.894 [4689:907] Font: Academy Engraved LET
2013-07-31 23:28:42.896 [4689:907] Attributes: {
NSFont = "Academy Engraved LET";
}
2013-07-31 23:28:42.898 [4689:907] Returning Academy Engraved LET{
NSFont = "Academy Engraved LET";
}
2013-07-31 23:28:42.920 [4689:907] -[__NSCFConstantString screenFontWithRenderingMode:]: unrecognized selector sent to instance 0x3977f364
2013-07-31 23:28:42.922 [4689:907] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFConstantString screenFontWithRenderingMode:]: unrecognized selector sent to instance 0x3977f364'