NSDictionary *titleAttributes = @{UITextAttributeTextColor: [UIColor whiteColor],
UITextAttributeTextShadowColor: [UIColor blackColor],
UITextAttributeTextShadowOffset: [NSValue valueWithUIOffset:UIOffsetMake(1,0)],
UITextAttributeFont: [UIFont titleBolder]};
[[UINavigationBar appearance] setTitleTextAttributes:titleAttributes];
and replaced them both with NSShadowAttributeName, and ended up with some code like this:
NSDictionary *titleAttributes = @{NSForegroundColorAttributeName: [UIColor whiteColor],
NSShadowAttributeName: [UIColor blackColor],
NSShadowAttributeName: [NSValue valueWithUIOffset:UIOffsetMake(1,0)],
NSFontAttributeName: [UIFont titleBolder]};
[[UINavigationBar appearance] setTitleTextAttributes:titleAttributes];
-->正确
NSShadow *shadow = [[NSShadow alloc] init];
shadow.shadowColor = [UIColor blackColor];
shadow.shadowOffset = CGSizeMake(1,0);
NSDictionary *titleAttributes = @{NSForegroundColorAttributeName: [UIColor whiteColor],
NSShadowAttributeName: shadow,
NSFontAttributeName: [UIFont titleBolder]};
[[UINavigationBar appearance] setTitleTextAttributes:titleAttributes];
http://stackoverflow.com/questions/18968305/ios-7-only-app-crashes-at-startup
http://stackoverflow.com/questions/19042724/uitextattributetextshadowoffset-is-deprecated