IOS 5无法识别的选择器在setBackgroundImage的外观代理发送 [英] IOS 5 unrecognized selector send at appearance proxy for setBackgroundImage
本文介绍了IOS 5无法识别的选择器在setBackgroundImage的外观代理发送的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
像许多开发人员一样,我正在使用IOS 5的新功能。
Like a lot of developers I am playing around with the new features of IOS 5.
我尝试使用外观代理来自定义我的应用程序。但在某些方法中我收到错误。
I tried to use appearance proxy's for customizing my App. But at some methods I get an error.
这有用:
[[UINavigationBar appearance] setBarStyle:UIBarStyleBlackTranslucent];
//and
[[UINavigationBar appearance] setTintColor:[UIColor greenColor]];
但是当我尝试:
[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"toolbar_background.png"]];
我收到一个无法识别的选择器错误:
I get an unrecognized selector error:
-[_UIAppearance setBackgroundImage:]: unrecognized selector sent to instance 0x153020
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_UIAppearance setBackgroundImage:]: unrecognized selector sent to instance 0x153020'
*** First throw call stack:
(0x3107a8bf 0x3821f1e5 0x3107dacb 0x3107c945 0x30fd7680 0x2fe7 0x3304c7eb 0x330463bd 0x33014921 0x330143bf 0x33013d2d 0x33bffe13 0x3104e553 0x3104e4f5 0x3104d343 0x30fd04dd 0x30fd03a5 0x33045457 0x33042743 0x2f31 0x2ec8)
terminate called throwing an exception(gdb)
任何想法?
推荐答案
该方法有一个不同的名称,你错过了它的一部分。由于iOS 5仍然在NDA下,我不会在这里引用或链接方法名称,但您可以自己查找:
The method has a different name, you're missing a part of it. Since iOS 5 is still under NDA, I won't cite or link the method name here, but you can look it up yourself:
- 转到 iOS开发人员中心。
- 选择 iOS SDK GM Seed 。
- 选择 iOS Developer Library 。
- 在搜索字段,开始输入 UINavigationBar 。
- 点击 UINavigationBar类参考链接。
- 阅读文档。
- Go to the iOS Dev Center.
- Select iOS SDK GM Seed.
- Select iOS Developer Library.
- In the search field, start typing UINavigationBar.
- Click on the UINavigationBar Class Reference link.
- Read the documentation.
这篇关于IOS 5无法识别的选择器在setBackgroundImage的外观代理发送的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文