简体   繁体   English

设置navigationBar的titleTextAttriubutes仅会使应用程序在ios 7.1设备上崩溃而不是模拟器

[英]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 这行代码曾经用于xcode 6 beta 4,我刚刚更新为xcode 6 beta 5,应用崩溃

你可以试试这个吗?

[[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()

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 自动旋转仅在设备上的模拟器中有效(IOS 7.1) - Autorotation only working in simulator not on device (IOS 7.1) iOS GL ES 2应用在设备上崩溃,但在模拟器上没有崩溃 - iOS GL ES 2 app crashes on device but not on simulator 仅在调试时在没有启动设备时iOS App崩溃-不在模拟器中或在正常启动设备应用程序时崩溃 - iOS App crashes on launch no device while debugging only - not in simulator or during normal device app launch 升级到iOS 9和MobileFirst 7.1后无法登录设备或模拟器上的应用程序 - Unable to login to app on device or simulator after upgrade to iOS 9 and MobileFirst 7.1 应用程序在设备上崩溃,但在模拟器上不崩溃 - App Crashes on Device but Not on Simulator iOS App在Simulator上运行正常,但在真实的iOS设备上崩溃 - iOS App works fine with Simulator but Crashes with a real iOS device 在模拟器(而非设备)上调试AppleWatch应用时,iOS应用立即崩溃 - iOS app crashes immediately when debugging AppleWatch app on Simulator (not on device) iOS应用程序在Xcode模拟器中运行良好,但速度很慢并且在设备上崩溃 - iOS app runs fine in Xcode simulator, but is slow and crashes on a device Expo 应用程序在 Expo Go 和 iOS 模拟器上工作,但在真实设备上崩溃 - Expo app working on Expo Go and iOS Simulator but crashes on real device IOs App可在模拟器上运行,但在设备上崩溃(主要是使用AVFoundation) - IOs App works on simulator but crashes on device (mainly using AVFoundation)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM