简体   繁体   中英

Setting titleTextAttriubutes of navigationBar crashes the app only on ios 7.1 device not simulator

Here is the code that crashes the app

navigationBar.titleTextAttributes = [NSForegroundColorAttributeName: NAV_BAR_TINT_COLOR]

This is the output

2014-08-13 18:21:47.567 demoapp[1214:60b] *** NSForwarding: warning: object 0x102e90000 of class '_TtCSs29_NativeDictionaryStorageOwner0000000156D27548' does not implement methodSignatureForSelector: -- trouble ahead
(lldb) 

This line used to work with xcode 6 beta 4, I just updated to xcode 6 beta 5 and app crashes

你可以试试这个吗?

[[UINavigationBar appearance]setTitleTextAttributes:@{UITextAttributeTextColor : [UIColor whiteColor]}];
  This code work for me.May be it's helpful for you.

 let titleDict: NSDictionary = [NSForegroundColorAttributeName: UIColor.greenColor()]
 self.navigationController.navigationBar.titleTextAttributes =  titleDict
 self.navigationController.navigationBar.tintColor = UIColor.whiteColor()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM