iOS6.0下奇怪的_UIRecordArgumentOfInvocationAtIndex异常

遇到的问题:

以下两种定制化UIBarButtonItem的代码在iOS7下没有问题:

[[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], nil] setTitleTextAttributes:@{NSForegroundColorAttributeName :[UIColor darkGrayColor]} forState:UIControlStateNormal];

[[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], nil] setTitleTextAttributes:@{@
“UITextAttributeTextColor”:[UIColor darkGrayColor]} forState:UIControlStateNormal];


但是在iOS下打开一些系统自带的ViewController(例如预览pdf的 QLPreviewController)的情况下遇到_UIRecordArgumentOfInvocationAtIndex异常。参照StackOverflow中类似情况的帖子,原来这应该是iOS SDK的一个Bug.以下简单的改动就可以帮你解决问题,也许这种小插曲也是编程乐趣的一部分。  微笑

解决方法:

使用以下方式后问题就解决了:

[[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], nil] setTitleTextAttributes:@{UITextAttributeTextColor:[UIColor darkGrayColor]} forState:UIControlStateNormal];

参照网址:

http://stackoverflow.com/questions/14125378/uiappearence-support-for-ios-6-unexpected-results

http://stackoverflow.com/questions/19863972/mfmailcomposeviewcontroller-crashes-because-of-global-appearance-properties-on-i

http://stackoverflow.com/questions/22489828/adbannerview-crashes-app-when-it-is-clicked

http://stackoverflow.com/questions/12567708/monotouch-ios-6-crash-when-using-mfmailcomposeviewcontroller

你可能感兴趣的:(ios,exception,Customization,appearance)