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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章